Skip to content

Commit

Permalink
feat: 접근 제어자 수정, GWShadow 파일 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
MaraMincho committed Nov 16, 2023
1 parent ab8d113 commit ab4f07f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
19 changes: 5 additions & 14 deletions iOS/Projects/Shared/DesignSystem/Sources/GWRoundShadowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ import UIKit

// MARK: - GWRoundShadowView

final class GWRoundShadowView: UIView {
public final class GWRoundShadowView: UIView {
let containerView = UIView()
let cornerRadius: CGFloat
let customShadow: CustomShadow
let customShadow: GWShadow
private var shadowLayer: CAShapeLayer!
private var fillColor: CGColor = UIColor.blue.cgColor

func update(color: UIColor) {
public func update(color: UIColor) {
fillColor = color.cgColor
}

override func layoutSubviews() {
override public func layoutSubviews() {
super.layoutSubviews()
if shadowLayer == nil {
shadowLayer = CAShapeLayer()
Expand All @@ -43,7 +43,7 @@ final class GWRoundShadowView: UIView {
}
}

init(shadow: CustomShadow, cornerRadius: CGFloat, backgroundColor: CGColor) {
public init(shadow: GWShadow, cornerRadius: CGFloat, backgroundColor: CGColor) {
customShadow = shadow
self.cornerRadius = cornerRadius
fillColor = backgroundColor
Expand All @@ -55,12 +55,3 @@ final class GWRoundShadowView: UIView {
fatalError("init(coder:) has not been implemented")
}
}

// MARK: - CustomShadow

struct CustomShadow {
let shadowColor: CGColor
let shadowOffset: CGSize
let shadowOpacity: Float
let shadowRadius: CGFloat
}
17 changes: 17 additions & 0 deletions iOS/Projects/Shared/DesignSystem/Sources/GWShadow.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// GWShadow.swift
// DesignSystem
//
// Created by MaraMincho on 11/16/23.
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved.
//
import CoreGraphics

// MARK: - GWShadow

public struct GWShadow {
let shadowColor: CGColor
let shadowOffset: CGSize
let shadowOpacity: Float
let shadowRadius: CGFloat
}

0 comments on commit ab4f07f

Please sign in to comment.