Last active
April 15, 2022 04:57
-
-
Save Nirajpaul2/92d95bce04252967820f9ce53f79dd8f to your computer and use it in GitHub Desktop.
CapitalizedWrapper
This file contains 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
@propertyWrapper | |
struct Capitalized { | |
var wrappedValue: String { | |
didSet { wrappedValue = wrappedValue.capitalized } | |
} | |
init(wrappedValue: String) { | |
self.wrappedValue = wrappedValue.capitalized | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment