Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
San Jose November 2016 Scouting Swift 3 @gregheo
Slide 2
Slide 2 text
NSSelectorForString @selector() ?
Slide 3
Slide 3 text
typedef struct objc_selector *SEL;
Slide 4
Slide 4 text
obj.performSelector("someSelector")
Slide 5
Slide 5 text
public struct Selector : ExpressibleByStringLiteral
Slide 6
Slide 6 text
obj.performSelector("someSelector") obj.performSelector(Selector("someSelector"))
Slide 7
Slide 7 text
#selector(NSString.init(coder:)) “initWithCoder:”
Slide 8
Slide 8 text
#keyPath(NSString.length) “length”: String
Slide 9
Slide 9 text
#keyPath #selector #available
Slide 10
Slide 10 text
Module File open public internal fileprivate { private } (scary outside world)
Slide 11
Slide 11 text
Function { } closure did not escape
Slide 12
Slide 12 text
Function { } closure escaped! # async store to property { }
Slide 13
Slide 13 text
@discardableResult @warn_unused_result
Slide 14
Slide 14 text
at the point of use is your most important goal CLARITY
Slide 15
Slide 15 text
func moveFromPoint(_ start: Point, toPoint: Point) moveFromPoint(startPoint, toPoint: endPoint)
Slide 16
Slide 16 text
func move(from start: Point, to end: Point) move(from: startPoint, to: endPoint)
Slide 17
Slide 17 text
NSString NSArray CGFloat NSIndexPath NSURLRequest
Slide 18
Slide 18 text
NSString NSArray CGFloat NSIndexPath NSURLRequest
Slide 19
Slide 19 text
let myQueue = DispatchQueue(label: "com.cocoaconf.queue") let mainQueue = DispatchQueue.main
Slide 20
Slide 20 text
myQueue.sync { print("Hello from a queue") } mainQueue.async { print("Hello async") }
Slide 21
Slide 21 text
myQueue.asyncAfter(deadline: .now() + 5, execute: ...) myQueue.asyncAfter(deadline: .now() + .nanoseconds(2500), execute: ...)
Slide 22
Slide 22 text
let renderer = UIGraphicsImageRenderer( bounds: CGRect(x: 0, y: 0, width: 100, height: 100)) let renderedImage = renderer.image { context in // drawing code goes here } UIImage
Slide 23
Slide 23 text
No content
Slide 24
Slide 24 text
No content
Slide 25
Slide 25 text
Safety Non-escaping closures Clarity / API changes Bridging Playgrounds
Slide 26
Slide 26 text
San Jose November 2016 Scouting Swift 3 @gregheo feedback $ %