×
Copy
Open
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
\Pen.pineapple.apple.pen A Swift 4 KeyPath Journey including el duderino, erased types, & a thinking cat Pikotaro - PPAP Elmar Kretzer - @elmkretzer
Slide 2
Slide 2 text
KeyWhat? new Swift 4 feature w/ more than 10 yrs Obj-C xp [dude setValue:@"lebowski" forKey:@"lastname"]; The Big Lebowski © Copyright Gramercy Pictures
Slide 3
Slide 3 text
the basics AnyKeyPath PartialKeyPath KeyPath WritableKeyPath
Slide 4
Slide 4 text
like a getter A) straight forward B) wrapped in function C) by KeyPath
Slide 5
Slide 5 text
like a setter A) straight forward B) wrapped in function C) by KeyPath
Slide 6
Slide 6 text
chain’em
Slide 7
Slide 7 text
any special tricks? https://www.instagram.com/corgnelius/ actually cool
Slide 8
Slide 8 text
supports type inferrence Generic Typealias for some optional something from a list of somethings Actually, something is an Int
Slide 9
Slide 9 text
supports optionals Chained optional properties - but only read
Slide 10
Slide 10 text
supports appending 1. KeyPath from Dictionary to Dictionary.Keys 2. KeyPath from Dictionary.Keys to Int 3. Compose both
Slide 11
Slide 11 text
A single expression that defines types and logic. so what?
Slide 12
Slide 12 text
... so let’s assume two distinct types & we want to map from one to the other and back again. Read & Write with same Expression...
Slide 13
Slide 13 text
LIVE CODING
Slide 14
Slide 14 text
Thanks for listening Follow-Up article including gists on: http://elm4ward.github.io/ Twitter: @elmkretzer