WWDC 2017
Session video and resources: https://developer.apple.com/videos/play/wwdc2017/244/
- NSCalendar
- Internet locking improvements
NSOperation
andNSOperationQueue
- Copy on write collections - return copy NSMutableArray as NSArray
- Subscripting Data is faster - indices
- malloc/free is not needed Data(count:250) implements
- ranges -subdata
- Toll-free bridging
- From a CF type to a NS Type
- From a NS type to a CF Type
- Zero cost at cast
- Extra cost at usage
- Swift bridging
- Costs are on the usage
- CFArrayGetCount((CFArrayRef(array))
NSTextStorage
-> NSMutableAttirutedString
var text = textView.textStorage.string // cost of copy
var text = textView.textStorage.mutableString // NO cost of copy <— USE THIS ONE FOR NOW (apple is working on a solution for future)
- NSAttributedString- NSRange without casting String - NSString
- NSRegularExpression - Range for UTF16-UTF8 without casting
- Autolayout practices
- Set rendering for attributed strings
- Specify alignment and writing direction if known.
baseWritingDirection = .leftToRight
- Use clip line breaking mode