@propertyWrapper: UpperCase String
With this @propertyWrapper code snippet you will be able to wrap String values into wrapped values of only upper case characters.
Property wrappers serve as a new type to wrap properties and add additional logic if needed. It's part of Swift since version 5.1 and can be useful to validate values with a set of rules or tranform values to match certain requirements etc.
As a simple example, you might want to ensure that String is using upper case, for example to correctly describe the abbreviation of federal states in the U.S. like California (CA) or New York (NY) or flight numbers and airport short codes such as Lufthase Flight 456 (LH456) and Frankfurt International Airport (FRA).
Become a free member or log in to proceed.