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

Codableはイケメン / 20160616 #otemachi_swift

Codableはイケメン / 20160616 #otemachi_swift

Otemachi.swift #01 - WWDC17 振り返り - connpass
https://nikkei.connpass.com/event/58452/
の発表資料です。

# 参考リンク

What's New in Foundation - WWDC 2017 - Videos - Apple Developer
https://developer.apple.com/videos/play/wwdc2017/212/

Swift 4から実装されるCodable/codable_in_foundation_with_swift4 // Speaker Deck
https://speakerdeck.com/fromkk/codable-in-foundation-with-swift4

Decodable - Pairs Taiwan // Speaker Deck
https://speakerdeck.com/muukii0803/decodable-pairs-taiwan

takasek

June 16, 2017
Tweet

More Decks by takasek

Other Decks in Programming

Transcript

  1. 6

  2. Codable ͷΠέϝϯϙΠϯτ 4 جຊతʹ࢖͍ํ͸ ܕʹ Codable Λ͚ͭΔ͚ͩʂ 4 ͚ͩͲCustomizable 4

    ͲΜͳEncoder/Decoderʹରͯ͠΋ (JSON, Plist, ·ͩݟ͵something...)࠶ར༻Մೳ 7
  3. 10

  4. 11

  5. Codable Philosophy͸௒Πέϝϯ 4 Error handling built-in 4 ૊Έࠐ·ΕͨΤϥʔ੍ޚ 4 Encapsulate

    encoding details 4 ΤϯίʔσΟϯάͷৄࡉΛΧϓηϧԽ 4 Abstract format from type 4 ந৅Խ͞ΕͨϑΥʔϚοτ 17
  6. Codable Philosophy͸௒Πέϝϯ 4 Error handling built-in 4 ૊Έࠐ·ΕͨΤϥʔ੍ޚ 4 Encapsulate

    encoding details 4 ΤϯίʔσΟϯάͷৄࡉΛΧϓηϧԽ 4 Abstract format from type 4 ந৅Խ͞ΕͨϑΥʔϚοτ 18
  7. σίʔυͷϑΣʔζ 1. σίʔυ 4 όΠτσʔλ 4 ߏ଄Λ࣋ͭόΠτσʔλ (JSON౳) 4 ܕ෇͚͞Εͨσʔλ(Swift

    ͷܕ) 2. όϦσʔγϣϯ 4 Domain-specific validation 4 Graph-level validation 21
  8. 22

  9. Codable Philosophy 4 Error handling built-in 4 ૊Έࠐ·ΕͨΤϥʔ੍ޚ 4 Encapsulate

    encoding details 4 ΤϯίʔσΟϯάͷৄࡉΛΧϓηϧԽ 4 Abstract format from type 4 ந৅Խ͞ΕͨϑΥʔϚοτ 24