[swift-evolution] [Review] SE-0086: Drop NS Prefix in Swift Foundation

Ben Rimmington me at benrimmington.com
Tue May 10 13:11:50 CDT 2016


+1 to dropping the NS prefix; type names are more readable. However:

* AppKit, CoreData, and TextKit will still use the NS prefix.
* Prefixed names (in all frameworks) are more "googleable".
* Should deprecated types (e.g. NSMessagePort) keep the prefix?

+1 to using nested enums/options; it will make method signatures shorter.

You could also have a nested RunLoop.Timer class (cf. CFRunLoopTimer) and
move your experimental `scheduledTimer` method to the RunLoop class.

Will top-level constants/functions also be nested? For example:

* SE-0033: Import Objective-C Constants as Swift Types
* SE-0044: Import as Member

Missing from the "Drop NS prefix" list:

* NSBinarySearchingOptions
* NSCopying, NSMutableCopying
* NSDirectoryEnumerator
* NSEnumerationOptions
* NSEnumerator
* NSExpression
* NSNull
* NSSecureCoding
* NSSortOptions

Missing from the "Hoisted types" list:

* NSAffineTransformStruct
* NSDateComponentsFormatterUnitsStyle
* NSDateComponentsFormatterZeroFormattingBehavior
* NSRoundingMode

-- Ben

More information about the swift-evolution mailing list