Created
February 5, 2023 18:53
-
-
Save foxicode/eadf249694846a51dff23ff2c9d5593f to your computer and use it in GitHub Desktop.
PropertyWrapper styles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| @propertyWrapper | |
| struct HeaderStyle { | |
| var wrappedValue: UILabel | |
| init(_ label: UILabel = .init()) { | |
| label.numberOfLines = 0 | |
| label.font = UIFont(name: "Helvetica Neue", size: 32) | |
| label.textColor = UIColor(red: 0.16, green: 0.16, blue: 0.16, alpha: 1.00) | |
| wrappedValue = label | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| @propertyWrapper | |
| struct ParagraphStyle { | |
| var wrappedValue: UILabel | |
| init(_ label: UILabel = .init()) { | |
| label.numberOfLines = 0 | |
| label.font = UIFont(name: "Georgia", size: 20) | |
| label.textColor = UIColor(red: 0.16, green: 0.16, blue: 0.16, alpha: 1.00) | |
| wrappedValue = label | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment