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

Swift API Design
 learning from Cocoa API changes

Swift API Design
 learning from Cocoa API changes

Cocoa API changesから学ぶSwift API Designについて。

Swift API Guidelines: https://swift.org/documentation/api-design-guidelines/
iOS 10 API Diffs: https://developer.apple.com/library/archive/releasenotes/General/iOS10APIDiffs/Swift/UIKit.html

PR:
毎週火曜日 iOS Night を開催しています
https://github.com/wantedly/ios_night

Kento Nagata

March 19, 2019
Tweet

More Decks by Kento Nagata

Other Decks in Technology

Transcript

  1. ©2019 Wantedly, Inc. Swift API Design
 learning from Cocoa API

    changes try! Swift Pre Talks 2019 Mar 19, 2019 - Kento Nagata
  2. ©2019 Wantedly, Inc.  'VOEBNFOUBMT  /BNJOH w 1SPNPUF$MFBS6TBHF w

    4USJWFGPS'MVFOU6TBHF w 6TF5FSNJOPMPHZ8FMM  $POWFOUJPOT w (FOFSBM$POWFOUJPOT w 1BSBNFUFST w "SHVNFOU-BCFMT  4QFDJBM *OTUSVDUJPOT "1*%FTJHO(VJEFMJOFT IUUQTTXJGUPSHEPDVNFOUBUJPOBQJEFTJHOHVJEFMJOFT
  3. ©2019 Wantedly, Inc.  'VOEBNFOUBMT  /BNJOH w 1SPNPUF$MFBS6TBHF w

    4USJWFGPS'MVFOU6TBHF w 6TF5FSNJOPMPHZ8FMM  $POWFOUJPOT w (FOFSBM$POWFOUJPOT w 1BSBNFUFST w "SHVNFOU-BCFMT  4QFDJBM *OTUSVDUJPOT "1*%FTJHO(VJEFMJOFT IUUQTTXJGUPSHEPDVNFOUBUJPOBQJEFTJHOHVJEFMJOFT Ұ൪ॏཁͳࢦ਑͕ॻ͔Ε͍ͯΔɻ
  4. ©2019 Wantedly, Inc.  'VOEBNFOUBMT  /BNJOH w 1SPNPUF$MFBS6TBHF w

    4USJWFGPS'MVFOU6TBHF w 6TF5FSNJOPMPHZ8FMM  $POWFOUJPOT w (FOFSBM$POWFOUJPOT w 1BSBNFUFST w "SHVNFOU-BCFMT  4QFDJBM *OTUSVDUJPOT "1*%FTJHO(VJEFMJOFT IUUQTTXJGUPSHEPDVNFOUBUJPOBQJEFTJHOHVJEFMJOFT ໌֬͞Λ࣮ݱ͢ΔͨΊͷϧʔϧɺ
 ΑΓ۩ମతͳύλʔϯɺޠኮͷબͼํ
  5. ©2019 Wantedly, Inc.  'VOEBNFOUBMT  /BNJOH w 1SPNPUF$MFBS6TBHF w

    4USJWFGPS'MVFOU6TBHF w 6TF5FSNJOPMPHZ8FMM  $POWFOUJPOT w (FOFSBM$POWFOUJPOT w 1BSBNFUFST w "SHVNFOU-BCFMT  4QFDJBM *OTUSVDUJPOT "1*%FTJHO(VJEFMJOFT IUUQTTXJGUPSHEPDVNFOUBUJPOBQJEFTJHOHVJEFMJOFT ΑΓ۩ମతͳέʔεͰͷ׳शɺ
 ύϥϝʔλ΍Ҿ਺ϥϕϧͷॻ͖ํ
  6. ©2019 Wantedly, Inc.  'VOEBNFOUBMT  /BNJOH w 1SPNPUF$MFBS6TBHF w

    4USJWFGPS'MVFOU6TBHF w 6TF5FSNJOPMPHZ8FMM  $POWFOUJPOT w (FOFSBM$POWFOUJPOT w 1BSBNFUFST w "SHVNFOU-BCFMT  4QFDJBM *OTUSVDUJPOT "1*%FTJHO(VJEFMJOFT IUUQTTXJGUPSHEPDVNFOUBUJPOBQJEFTJHOHVJEFMJOFT ͦͷଞɺಛघͳέʔεʹ͍ͭͯ
  7. ©2019 Wantedly, Inc.  'VOEBNFOUBMT  /BNJOH w 1SPNPUF$MFBS6TBHF w

    4USJWFGPS'MVFOU6TBHF w 6TF5FSNJOPMPHZ8FMM  $POWFOUJPOT w (FOFSBM$POWFOUJPOT w 1BSBNFUFST w "SHVNFOU-BCFMT  4QFDJBM *OTUSVDUJPOT "1*%FTJHO(VJEFMJOFT IUUQTTXJGUPSHEPDVNFOUBUJPOBQJEFTJHOHVJEFMJOFT ࠓ೔औΓ্͛Δ෦෼
  8. ©2019 Wantedly, Inc. "GUFS UIView.point(inside: CGPoint, with: UIEvent?) -> Bool

    UIView.pointInside(_: CGPoint, withEvent: UIEvent?) -> Bool #FGPSF લஔࢺ۟ΛϥϕϧʹؚΊΔ iOS 10 - - iOS 9