File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -142,10 +142,7 @@ extension UKCard {
142142 view. layer. cornerRadius = model. cornerRadius. value
143143 view. layer. borderWidth = 1
144144 view. layer. borderColor = UniversalColor . divider. cgColor
145- view. layer. shadowRadius = model. shadow. radius
146- view. layer. shadowOffset = model. shadow. offset
147- view. layer. shadowColor = model. shadow. color. cgColor
148- view. layer. shadowOpacity = 1
145+ view. shadow ( model. shadow)
149146 }
150147
151148 static func contentView( _ view: UIView , model: Model ) {
Original file line number Diff line number Diff line change 11import SwiftUI
2+ import UIKit
23
34/// Defines shadow options for components.
45public enum Shadow : Hashable {
@@ -51,6 +52,17 @@ extension Shadow {
5152 }
5253}
5354
55+ // MARK: - UIKit + Shadow
56+
57+ extension UIView {
58+ func shadow( _ shadow: Shadow ) {
59+ self . layer. shadowRadius = shadow. radius
60+ self . layer. shadowOffset = shadow. offset
61+ self . layer. shadowColor = shadow. color. cgColor
62+ self . layer. shadowOpacity = 1
63+ }
64+ }
65+
5466// MARK: - SwiftUI + Shadow
5567
5668extension View {
You can’t perform that action at this time.
0 commit comments