Speaker Deck
Speaker Deck Pro
Sign in
Sign up
for free
Shared, Exclusive, Mutable, Immutable
Greg Heo
May 10, 2018
Technology
0
28
Shared, Exclusive, Mutable, Immutable
NSBudapest, May 2018
Greg Heo
May 10, 2018
Tweet
Share
More Decks by Greg Heo
See All by Greg Heo
gregheo
0
65
gregheo
0
45
gregheo
0
150
gregheo
0
16
gregheo
0
490
gregheo
0
62
gregheo
0
34
gregheo
0
96
gregheo
3
160
Other Decks in Technology
See All in Technology
soachr
0
150
shirayanagiryuji
0
1.4k
cmwatanabeseigo
0
320
hamadakoji
0
1.1k
kappa4
4
2k
line_developers
PRO
0
140
yuuturn
1
130
clustervr
0
190
line_developers
PRO
2
1.2k
suzukiry
0
200
ocise
1
910
kanaugust
PRO
0
210
Featured
See All Featured
chriscoyier
684
180k
smashingmag
283
47k
gr2m
83
11k
mza
80
4.1k
samanthasiow
56
6.3k
ddemaree
274
31k
shlominoach
176
7.4k
aarron
258
36k
shpigford
165
19k
jakevdp
774
200k
danielanewman
1
470
searls
204
35k
Transcript
@gregheo ! NSBudapest, May 2018 Shared Exclusive Mutable Immutable
@gregheo ! NSBudapest, May 2018 Data "
@gregheo ! NSBudapest, May 2018 Code Example #
@gregheo ! NSBudapest, May 2018 Exclusive Shared Immutable Mutable
@gregheo ! NSBudapest, May 2018 Exclusive Shared Immutable Mutable
@gregheo ! NSBudapest, May 2018 Exclusive Shared Immutable private let
Screen size / scale Mutable private var private queue $
@gregheo ! NSBudapest, May 2018 Fewer entry points
@gregheo ! NSBudapest, May 2018 Private queues
@gregheo ! NSBudapest, May 2018 Queue Callback
@gregheo ! NSBudapest, May 2018 // call from anywhere!
public func something() { privateQueue.sync { … } }
@gregheo ! NSBudapest, May 2018 // always call on
the main queue! public func something()
@gregheo ! NSBudapest, May 2018 // always call on
the main queue! public func something() { dispatchPrecondition(condition: .onQueue(.main)) }
@gregheo ! NSBudapest, May 2018 Make it difficult to get
wrong
@gregheo ! NSBudapest, May 2018 köszönöm! ☺