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

Preparing for Swift 5 Ownership

Preparing for Swift 5 Ownership

Swift 5 の Ownership に備える

try! Swift Tokyo 2018 #tryswiftconf
https://www.tryswift.co/events/2018/tokyo/en/

kotetu (kotetuco)

March 02, 2018
Tweet

More Decks by kotetu (kotetuco)

Other Decks in Technology

Transcript

  1. Kuriyama Toru <܀ࢁప> iOS Engineer at Sansan app (iOS/Android) “Business

    card-based contact management” Twitter: @kotetuɹɹɹɹɹɹ Github: @kotetuco
  2. Example (shared values) func distance(start: shared CGPoint, end: shared CGPoint)

    -> Double { ... } let result = distance(start: CGPoint(x: 0, y: 0), end: CGPoint(x: 10, y: 10))
  3. Example (shared values) func distance(start: shared CGPoint, end: shared CGPoint)

    -> Double { ... } let result = distance(start: CGPoint(x: 0, y: 0), end: CGPoint(x: 10, y: 10)) not copied not copied
  4. func distance(start: shared CGPoint, end: shared CGPoint) -> Double {

    ... } let result = distance(start: CGPoint(x: 0, y: 0), end: CGPoint(x: 10, y: 10)) Example (shared values) not copied read-only not copied read-only