Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Shared, Exclusive, Mutable, Immutable

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

Shared, Exclusive, Mutable, Immutable

NSBudapest, May 2018

Avatar for Greg Heo

Greg Heo

May 10, 2018

More Decks by Greg Heo

Other Decks in Technology

Transcript

  1. @gregheo ! NSBudapest, May 2018 Exclusive Shared Immutable private let

    Screen size / scale Mutable private var
 private queue $
  2. @gregheo ! NSBudapest, May 2018 
 // call from anywhere!


    public func something() {
 privateQueue.sync { … } }

  3. @gregheo ! NSBudapest, May 2018 
 // always call on

    the main queue!
 public func something() 

  4. @gregheo ! NSBudapest, May 2018 
 // always call on

    the main queue!
 public func something() {
 dispatchPrecondition(condition: .onQueue(.main))
 }