From ab4f07f6929bc56a450de323d608bad0550bdb72 Mon Sep 17 00:00:00 2001 From: MaraMincho <103064352+MaraMincho@users.noreply.github.com> Date: Thu, 16 Nov 2023 17:16:31 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A0=91=EA=B7=BC=20=EC=A0=9C=EC=96=B4?= =?UTF-8?q?=EC=9E=90=20=EC=88=98=EC=A0=95,=20GWShadow=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/GWRoundShadowView.swift | 19 +++++-------------- .../DesignSystem/Sources/GWShadow.swift | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 iOS/Projects/Shared/DesignSystem/Sources/GWShadow.swift diff --git a/iOS/Projects/Shared/DesignSystem/Sources/GWRoundShadowView.swift b/iOS/Projects/Shared/DesignSystem/Sources/GWRoundShadowView.swift index eb811c8f..0a6a0574 100644 --- a/iOS/Projects/Shared/DesignSystem/Sources/GWRoundShadowView.swift +++ b/iOS/Projects/Shared/DesignSystem/Sources/GWRoundShadowView.swift @@ -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() @@ -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 @@ -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 -} diff --git a/iOS/Projects/Shared/DesignSystem/Sources/GWShadow.swift b/iOS/Projects/Shared/DesignSystem/Sources/GWShadow.swift new file mode 100644 index 00000000..57f1f676 --- /dev/null +++ b/iOS/Projects/Shared/DesignSystem/Sources/GWShadow.swift @@ -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 +}