the following presentation may contain excessive...
TRANSCRIPT
![Page 1: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/1.jpg)
THE FOLLOWING PRESENTATION MAY CONTAIN
EXCESSIVE USE OF ANIMATIONSAND
IMAGES OF QUESTIONABLE TASTETHOSE OF A SENSITIVE NATURE SHOULD LEAVE NOW
Tuesday, 29 October 13
![Page 2: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/2.jpg)
What’s New in iOS 7
Tuesday, 29 October 13
![Page 3: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/3.jpg)
What’s New in iOS 7
TextKit
UIKit Dynamics
Multitasking
NSURLSession
NSProgress
SpriteKit
Game Controllers
AirDrop
Inter-App Audio
Multipeer Connectivity
JavaScript Core
Media Accessibility
Safari Services
OpenGL ES 3.0
Message Attachments
NSURLComponentsiBeacons
Modules
Tuesday, 29 October 13
![Page 4: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/4.jpg)
What’s New in iOS 7…
Tuesday, 29 October 13
![Page 5: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/5.jpg)
What’s New in iOS 7for Hipsters
Tuesday, 29 October 13
![Page 6: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/6.jpg)
What’s New in iOS 7for Hipsters
Tuesday, 29 October 13
![Page 7: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/7.jpg)
Until…
Tuesday, 29 October 13
![Page 8: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/8.jpg)
NSi OS 7With the NDA finally lifted, we can finally talk about all of the amazing new APIs in iOS 7. And thereare a lot of them. "1500 new APIs", by Apple's count during the WWDC Keynote. (Granted, a goodportion of that could just be all of the changes from id to instancetype, but that's a hugenumber, regardless).
We'll be going over many of the new features iOS 7 in depth over the coming weeks, but with all ofthe excitement around this major release, this week's issue will hit on some of the gems hiding inplain sight: NSData Base64 encoding, NSURLComponents, NSProgress, NSProcessInfoactivities, CIDetectorSmile, CIDetectorEyeBlink, SSReadingList,AVCaptureMetaDataOutput, AVSpeechSynthesizer, and MKDistanceFormatter.
NSData (NSDataBase64Encoding)
Written by Mattt Thompson on Sep 23rd, 2013
Tuesday, 29 October 13
![Page 9: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/9.jpg)
What’s New in iOS 7for Hipsters
Tuesday, 29 October 13
![Page 10: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/10.jpg)
What’s New in iOS 7 for the Hipster’s Hipster
Tuesday, 29 October 13
![Page 11: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/11.jpg)
But first
Tuesday, 29 October 13
![Page 12: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/12.jpg)
But first
A dirty secret
Tuesday, 29 October 13
![Page 13: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/13.jpg)
But first
A dirty secret
I’m a Mac developer
Tuesday, 29 October 13
![Page 14: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/14.jpg)
GCD
FoundationImageIO
CoreFoundation
CoreGraphics
Tuesday, 29 October 13
![Page 15: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/15.jpg)
dispatch_data
Tuesday, 29 October 13
![Page 16: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/16.jpg)
dispatch_data
• Introduced in OS X 10.7 / iOS 5
Tuesday, 29 October 13
![Page 17: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/17.jpg)
dispatch_data
• Introduced in OS X 10.7 / iOS 5
• C-level immutable container for raw data, similar to NSData
Tuesday, 29 October 13
![Page 18: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/18.jpg)
Concatenating Data
NSData
NSData
Tuesday, 29 October 13
![Page 19: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/19.jpg)
Concatenating Data
NSData
NSDataNSMutableData
Tuesday, 29 October 13
![Page 20: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/20.jpg)
Concatenating Data
NSData
NSData
[ appendData:
[ appendData:
]
]NSMutableData
Tuesday, 29 October 13
![Page 21: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/21.jpg)
Concatenating Data
NSData
NSData
[ appendData:
[ appendData:
]
]bytesNSMutableDataNSMutableData
Tuesday, 29 October 13
![Page 22: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/22.jpg)
Concatenating Data
NSData
NSData
[ appendData:
[ appendData:
]
]bytesbytesNSMutableDataNSMutableDataNSMutableData
Tuesday, 29 October 13
![Page 23: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/23.jpg)
• Bytes are copied, potentially wastefully
Concatenating Data
NSData
NSData
[ appendData:
[ appendData:
]
]bytesbytesNSMutableDataNSMutableDataNSMutableData
Tuesday, 29 October 13
![Page 24: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/24.jpg)
Concatenating Data
dispatch_data_t
dispatch_data_t
Tuesday, 29 October 13
![Page 25: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/25.jpg)
Concatenating Data
dispatch_data_t
dispatch_data_tdispatch_data_create_concat( )
Tuesday, 29 October 13
![Page 26: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/26.jpg)
dispatch_data_t
Concatenating Data
dispatch_data_tdispatch_data_t
dispatch_data_create_concat( )
Tuesday, 29 October 13
![Page 27: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/27.jpg)
dispatch_data_t
Concatenating Data
dispatch_data_tdispatch_data_t
dispatch_data_create_concat( )
• References, rather than copies the raw bytes
Tuesday, 29 October 13
![Page 28: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/28.jpg)
“Alright, neat, but how does it affect me?”
Tuesday, 29 October 13
![Page 29: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/29.jpg)
dispatch_data
Tuesday, 29 October 13
![Page 30: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/30.jpg)
dispatch_data
• Toll-free bridged with NSData
• dispatch_data_t can be freely cast to NSData *
• But not vice versa
Tuesday, 29 October 13
![Page 31: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/31.jpg)
dispatch_data
• Toll-free bridged with NSData
• dispatch_data_t can be freely cast to NSData *
• But not vice versa
• NSData instances may now contain non-contiguous bytes
Tuesday, 29 October 13
![Page 32: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/32.jpg)
dispatch_data
• Toll-free bridged with NSData
• dispatch_data_t can be freely cast to NSData *
• But not vice versa
• NSData instances may now contain non-contiguous bytes
• -[NSData bytes] might have to make a copy of the bytes for you
Tuesday, 29 October 13
![Page 33: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/33.jpg)
dispatch_data
• Toll-free bridged with NSData
• dispatch_data_t can be freely cast to NSData *
• But not vice versa
• NSData instances may now contain non-contiguous bytes
• -[NSData bytes] might have to make a copy of the bytes for you
• Switch from -bytes to -enumerateByteRangesUsingBlock:
Tuesday, 29 October 13
![Page 34: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/34.jpg)
Memory Management
• When using ARC, still have to drop down to manual reference counting for CoreFoundation objects sometimes:
• CFRetain()
• CFRelease()
Tuesday, 29 October 13
![Page 35: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/35.jpg)
Memory Management
• When using ARC, still have to drop down to manual reference counting for CoreFoundation objects sometimes:
• CFRetain()
• CFRelease()
• CFAutorelease()
Tuesday, 29 October 13
![Page 36: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/36.jpg)
CFStream scheduling
• So far have been scheduled on run loops
• Convenient on the main thread
• More of a hassle on other threads; likely have to run the run loop yourself
Tuesday, 29 October 13
![Page 37: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/37.jpg)
CFStream scheduling
• So far have been scheduled on run loops
• Convenient on the main thread
• More of a hassle on other threads; likely have to run the run loop yourself
• CFReadStreamSetDispatchQueue() and CFWriteStreamSetDispatchQueue()
Tuesday, 29 October 13
![Page 38: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/38.jpg)
CFStream scheduling
• So far have been scheduled on run loops
• Convenient on the main thread
• More of a hassle on other threads; likely have to run the run loop yourself
• CFReadStreamSetDispatchQueue() and CFWriteStreamSetDispatchQueue()
• Should work for NSInputStream And NSOutputStream too thanks to toll-free bridging
Tuesday, 29 October 13
![Page 39: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/39.jpg)
Base64
Tuesday, 29 October 13
![Page 40: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/40.jpg)
Base64
• New methods on NSData for Base64 encoding and decoding
Tuesday, 29 October 13
![Page 41: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/41.jpg)
Base64
• New methods on NSData for Base64 encoding and decoding
• But you knew that already, right?
Tuesday, 29 October 13
![Page 42: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/42.jpg)
Base64
• New methods on NSData for Base64 encoding and decoding
• But you knew that already, right?
• Rudimentary support is available back to OS X 10.6 / iOS 4
- (id)initWithBase64Encoding:(NSString *)base64String;
- (NSString *)base64Encoding;
Tuesday, 29 October 13
![Page 43: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/43.jpg)
Sorting and Filtering NSOrderedArray
-sortedArrayUsingDescriptors:
-sortUsingDescriptors:
-filteredOrderedSetUsingPredicate:
-filterUsingPredicate:
• Been there as long as NSOrderedSet itself, but only just exposed
Tuesday, 29 October 13
![Page 44: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/44.jpg)
NSSecureCoding
• Extension to NSCoding
• Introduced in OS X 10.8 / iOS 6
• Protects against corrupt or maliciously crafted archives
-decodeObjectOfClass:forKey:
-decodeObjectOfClasses:forKey:
• Only protects against class changes
Tuesday, 29 October 13
![Page 45: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/45.jpg)
NSSecureCoding
• Deeper checking through -allowEvaluation on classes:
• NSSortDescriptor
• NSPredicate
• NSExpression
• Check the key paths etc. of an object to check they’re suitable for your app, then call -allowEvaluation
Tuesday, 29 October 13
![Page 46: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/46.jpg)
NSSecureCoding — General Advice
1.Adopt instead of raw NSCoding
2.Tell decoder to use it:
‑[NSKeyedUnarchiver setRequiresSecureCoding:YES]
Doesn’t have to be done at the same time as 1.
Tuesday, 29 October 13
![Page 47: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/47.jpg)
CGPathCreateWithRoundedRect()
• How did it take this long?!
Tuesday, 29 October 13
![Page 48: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/48.jpg)
CGImageSource workflow
• On worker thread:
• Create CGImageSource
• Retrieve CGImage
• Draw into a small bitmap context to force decompression
• On main thread
• Draw into desired context
Tuesday, 29 October 13
![Page 49: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/49.jpg)
kCGImageSourceShouldCacheImmediately
• Pass as a flag when retrieving a CGImage
• Should force decompression without all that tedious mucking about in hyperspace bitmap contexts
• Test and Measure; don’t use blindly!
Tuesday, 29 October 13
![Page 50: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/50.jpg)
Bonus Hipster Quiz Question
What is the only public class in the Cocoa frameworks that has no methods of its own?
Tuesday, 29 October 13
![Page 51: THE FOLLOWING PRESENTATION MAY CONTAIN EXCESSIVE …mikeabdullah.net/whats-new-in-ios-7/whats-new-in-ios-7-for.pdf · • -[NSData bytes] might have to make a copy of the bytes for](https://reader033.vdocument.in/reader033/viewer/2022060223/5f07ce987e708231d41ed84b/html5/thumbnails/51.jpg)
Bonus Hipster Quiz Question
“you wouldn’t have heard of it…”
What is the only public class in the Cocoa frameworks that has no methods of its own?
Tuesday, 29 October 13