File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -141,10 +141,7 @@ extension UKCard {
141141 view. layer. cornerRadius = model. cornerRadius. value
142142 view. layer. borderWidth = 1
143143 view. layer. borderColor = UniversalColor . divider. cgColor
144- view. layer. shadowRadius = model. shadow. radius
145- view. layer. shadowOffset = model. shadow. offset
146- view. layer. shadowColor = model. shadow. color. cgColor
147- view. layer. shadowOpacity = 1
144+ view. shadow ( model. shadow)
148145 }
149146
150147 static func contentView( _ view: UIView , model: Model ) {
Original file line number Diff line number Diff line change 1- import Foundation
1+ import UIKit
22
33/// Defines shadow options for components.
44public enum Shadow : Hashable {
@@ -50,3 +50,14 @@ extension Shadow {
5050 }
5151 }
5252}
53+
54+ // MARK: - UIKit + Shadow
55+
56+ extension UIView {
57+ func shadow( _ shadow: Shadow ) {
58+ self . layer. shadowRadius = shadow. radius
59+ self . layer. shadowOffset = shadow. offset
60+ self . layer. shadowColor = shadow. color. cgColor
61+ self . layer. shadowOpacity = 1
62+ }
63+ }
You can’t perform that action at this time.
0 commit comments