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

Shared, Exclusive, Mutable, Immutable

Shared, Exclusive, Mutable, Immutable

NSBudapest, May 2018

Greg Heo

May 10, 2018
Tweet

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))
 }