Last active
April 2, 2021 09:13
-
-
Save SURYAKANTSHARMA/ad570e0b25d0d27b85fcdb46c482b4c4 to your computer and use it in GitHub Desktop.
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 Currency { | |
var projectedValue: Bool | |
// This is must stored property in every property wrapper | |
var wrappedValue: String { | |
didSet { | |
wrappedValue = "₹ " + wrappedValue | |
projectedValue = wrappedValue.contains(",") | |
} | |
} | |
init(wrappedValue: String) { | |
projectedValue = wrappedValue.contains(",") | |
self.wrappedValue = "₹ " + wrappedValue | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment