In Swift, Apple's UITextContentType is a struct with many static properties of type UITextContentType such as:
static let URL: UITextContentTypestatic let addressCity: UITextContentTypestatic let addressCityAndState: UITextContentType
etc.
But UIKit/UITextInputTraits.h has:
typedef NSString * UITextContentType NS_TYPED_ENUM;
And I notice that within Swift, the compiler infers UITextContentType, allowing you to simply use .URL or .addressCityAndState instead of UITextContentType.URL or UITextContentType.addressCityAndState for any function argument that takes type UITextContentType (thereby treating it just like an enum).
So why didn't they just use an enum to begin with? What's the advantage of using this pattern...? When would we want to use this pattern in our own code?