Class properties
For historical reasons, the Foundation framework contains many cases where the state of a property is closely associated with the type. Therefore, you will find lots of class properties on Objective-C types. New for the Swift 3 release, we get a tweak to Objective-C that allows us to use a new syntax for creating class properties. These class properties in Objective-C will be imported into Swift as class properties as well.
In Objective-C (old way):
@interface NSCharacterSet + (NSCharacterSet *)controlCharacterSet; + (NSCharacterSet *)whitespaceCharacterSet; + (NSCharacterSet *)whitespaceAndNewlineCharacterSet; @end
In Objective-C (new way):
@interface NSCharacterSet @property(class, readonly, strong) controlCharacterSet; @property(class, readonly, strong) whitespaceCharacterSet; @property(class, readonly, strong) whitespaceAndNewlineCharacterSet; @end
In Swift 2.2:
class NSCharacterSet{ class func controlCharacters...