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

Swift Weekly 2017-05-02

Swift Weekly 2017-05-02

3f7d9611fc919c98512b779cde637dfc?s=128

Johnlin

May 02, 2017
Tweet

Transcript

  1. Swift पใ 2017/05/02 John Lin @johnlinvc

  2. From the core • ABI ᜦఆੑّද൘ • ఔࣜᛰ૬༰ੑଌࢼܥ౷

  3. ABI ᜦఆੑّද൘ • ABI ᜦఆ୅දෆಉ൛ຊSwift ฤᩄग़ိతവࣜݿ (.dylib/.framework) ՄҎޓ૬૬༰ɻ໨લؐෆߦɻ • ّද൛ྻग़ୡ੒

    ABI ᜦఆؐधཁ၏తमվɼؐ༗ଞ ၇ݱࡏత㐫گɻ
  4. ఔࣜᛰ૬༰ੑଌࢼܥ౷ • Swift 4 త໨ඪ೭Ұੋཁࡏ Swift 3 ໛ࣜԼ޲Լ૬༰ɼ ໵बੋ㘸Swift 3

    తఔࣜᛰෆ༻मվबೳ៺᠃࢖༻ɻ • ҝྃ֬อ޲Լ૬༰తᜦఆੑɼCI ܥ౷။ࣗಈଌࢼ֤ വࣜݿత૬༰ੑɼแؚ Realm, Alamofire, Perfect, vapor ౳౳ɻ
  5. Evolution • SE-0155 Enum case දࣔ๏ਖ਼نԽ • SE-0161 ߋ޷తKey Value

    Coding • SE-0162 ౟݅؅ཧث٬੍Խࢿྉᇄ݁ߏ • SE-0163 վྑࣈ۲ɿࢧԉCollection, C ૬༰ੑ • SE-0164 Protocol extension ෆೳ༻ final
  6. SE-0155 Enum case දࣔ๏ਖ਼ن Խ • ݱࡏ Enum એࠂత case

    ଖመੋ༻ᔒ༗ඪតతTuple መ࡞తɼ೭ޙ။վ੒࿨Ұൠత class Ұᒬɻ • ॴҎ೭ޙ Enum ໵ՄҎ༗༬ઃᆴɼؐ༗ಉҰݸ ໊᜝ ୠෆಉඪតత൛ຊɻ • ୠੋჩᏐత࿩ Void ཁଧग़ိɻ
  7. SE-0155 Enum case දࣔ๏ਖ਼ن Խ

  8. SE-0155 Enum case දࣔ๏ਖ਼ن Խ • ݱࡏ
 
 
 


    
 ະိ
 
 
 

  9. SE-0161 ߋ޷తKey Value Coding • ݱࡏత key value coding ੋ༻

    #keypath() ိදࣔɼ جຊबੋᱛᨽաతࣈ۲ɻ୞༗NSObject ࠽ೳ༻ • ৽⃧Ұݸ \.<path> తදࣔ๏ɼ౥഑ [keyPath: ] ࢖ ༻ɻ
  10. SE-0161 ߋ޷తKey Value Coding

  11. SE-0161 ߋ޷తKey Value Coding

  12. SE-0161 ߋ޷తKey Value Coding

  13. SE-0162 ౟݅؅ཧث٬੍Խࢿྉ ᇄ݁ߏ • ݱࡏ౟݅؅ཧث࢖༻༬ઃత࿏ኸိ؅ཧ䈕Ҋɼ Sources ब์ఔࣜᛰɼTests ब์ଌࢼɻ • ሢҊҰେब኷೉༻ɻ

    • ະိॴ༗໨ඪతࢿྉᇄ౎ඞध໌֬஍ྻग़ိ
  14. SE-0162 ౟݅؅ཧث٬੍Խࢿྉ ᇄ݁ߏ

  15. SE-0163 վྑࣈ۲ɿࢧԉ Collection, C ૬༰ੑ • Swift 2 ೺ࣈ۲ᙛ collection

    ༻ޭೳ፤ᎃྃɼSwift 4 ။Ճ ճိʂ • ။৽⃧Ұݸ Substring Type ိଘ੾աతࣈ۲ɼෆաෆݐ ٞ༻ိ௕ظṶଘɼ༰қ٣ଠଟهԱᱪɻ • ৽⃧Ұݸ Unicode protocol ိᙛ၏ String ࿨ Substring తجఈɼํศ၏ᔟܕ • ৽⃧زݸኺC ࣈ۲᫚׵੒ Swift ࣈ۲తവᏐ
  16. SE-0164 Protocol extension ෆೳ༻ final • Protocol extension ຊိबෆೳඃվሜɼ༗ᔒ༗Ճ final

    ౎Ұᒬɻ • ೭ޙՃྃ final ब။༗ࡨޡɼෆա։ swift 3 ໛ࣜత࿩ ୞။༗ܯࠂɻ
  17. Evolution • SE-0165 Ճڧ Dictionary ࿨ Set • SE-0166 ෧ଘᢛংྻԽ

    • SE-0167 ฤᛰث • SE-0168 ଟߦᏐతࣈ۲
  18. SE-0165 Ճڧ Dictionary ࿨ Set • Dictionary ࿨ Set ༻ىိෆⴺ޷༻ɼڧԽྃԼ໘زᴍ

    • ኺ Array 㗞ੜ Dictionaryɼ߹ซ Dictionary • औᆴ࣌೗ՌKey ෆଘࡏՄҎڅ༬ઃᆴ • Dictionary ࿨ Set త map & filter • ՄҎ؃౸ Dictionary ࿨ Set త༰ྔ • ՄҎሣ Array ၏ group by
  19. SE-0165 Ճڧ Dictionary ࿨ Set • ኺ Array 㗞ੜ Dictionary

    • ݱࡏ୞ೳखಈ೺ Array ᫚੒ Dictionary ɼ೭ޙՄҎࣗ ಈ೺ tuple array ᫚੒ Dictionary
  20. SE-0165 Ճڧ Dictionary ࿨ Set • ߹ซDictionary • ݱࡏ୞ೳखಈҰݸҰݸ೺ᆴ߹ซɼ೭ޙ୞ཁఏڙҰݸ ղܾ

    key ॏෳత closure बՄҎࣗಈ߹ซ
  21. SE-0165 Ճڧ Dictionary ࿨ Set • ᩇሜᆴℭೂݔKey ෆଘࡏՄҎڅ༬ઃᆴ • ݱࡏ୞ೳखಈऔҰ࣍؃؃ੋෆੋnil,

    ੋత࿩࠶څ༬ઃ ᆴɻ೭ޙՄҎ௚઀ࡏsubscript ఏڙ༬ઃᆴɻ
  22. SE-0165 Ճڧ Dictionary ࿨ Set • Dictionary త mapValues •

    ݱࡏ୞ೳmap׬೭ޙ࠶खಈݐཱҰ࣍ Dictionaryɻ೭ ޙՄҎሣValue ၏ mapɻ
  23. SE-0165 Ճڧ Dictionary ࿨ Set • Dictionary ࿨ Set త

    filter • ݱࡏ୞ೳfilter ׬೭ޙ࠶खಈݐཱҰ࣍ Dictionaryɻ೭ ޙՄҎ௚઀၏ filter ɼ။ճၚҰݸ Dictionaryɻ
  24. SE-0165 Ճڧ Dictionary ࿨ Set • ՄҎ؃౸ Dictionary ࿨ Set

    త༰ྔ • ໵ՄҎखಈ⃧Ճ༰ྔ
  25. SE-0165 Ճڧ Dictionary ࿨ Set • ՄҎሣ Array ၏ group

    by
  26. SE-0166 ෧ଘᢛংྻԽ • ݱࡏ୞ೳᯪ NSCoder ိ၏ংྻԽɼॴҎ Struct ࿨ Enum ౎ෆೳඃংྻԽɻ

    • ။৽⃧ Encoder, Decoder, Encodable ࿨ Decodable protocolိ႔ཧংྻԽɼࢧԉ Class, Struct ࿨ Enum • ؐ༗ Codable protocol ୅දՄҎ᫚׵ग़ڈ࠶ճိ
  27. SE-0166 ෧ଘᢛংྻԽ

  28. SE-0167 ฤᛰث • ఏڙၷछংྻԽతฤᛰثɼ json ࿨ plist • 㚎ݐతdata type

    ࿨ collection type ౎ՄҎඃࣗಈ᫚ ׵ • ؐ༗Ұථ Foundation త class แؚ Date, URL ౳౳ • Codable ။࿨ NSKeyed[Un]Archiver ૬༰
  29. SE-0168 ଟߦᏐతࣈ۲ • ࢧԉލߦతࣈ۲ɼ࿨ Python Ұᒬ༻ࡾݸძҾᥒိᙛ ։಄࿨݁ඌ • ။Ҏ݁ඌతॖഉҝج४ɼࣗಈ੾ᎃ㑌Ұߦ։಄తۭനɻ

  30. SE-0168 ଟߦᏐతࣈ۲

  31. Evolution • SE-0169 ༏Խ private ࿨ extension ೭ؒత᮫܎ • SE-0170

    NSNumber ڮ઀վળ • SE-0171 ༻ inout ိ reduce • SE-0172 ୞༗Ұᬑత Range • SE-0173 ৽⃧ MutableCollection.swapAt(_:_:)
  32. SE-0169 ༏Խ private ࿨ extension ೭ؒత᮫܎ • ݱࡏprivate member ୞༗ࡏఆٛతׅᥒൣᅴ㚎࠽ೳ

    ଘऔɼಉҰݸ䈕Ҋ㚎ෆߦɼཁվ༻fileprivate • େՈ౎تᓣ༻extension ိఆٛfunctionɼ଄੒኷ଟ ෆඞཁత fileprivate • ೭ޙಉҰݸ䈕Ҋ㚎త extension ໵ՄҎଘऔ private member
  33. SE-0170 NSNumber ڮ઀վળ • ݱࡏNSNumber ࿨ Swift త᫚׵༗ᴍոոత

  34. SE-0170 NSNumber ڮ઀վળ • ্໘తᆴੋ -1 (0x11111111) • ೭ޙ༻ as?

    ᫚׵࣌။ߟྔ໨ඪతେখɼݱ༗తኺ NSNumber ᫚աိతํ๏။෼੒ၷݸ

  35. SE-0171 ༻ inout ိ reduce • ။৽⃧Ұݸ Sequence#reduce(into:_) ိ၏ in-place

    త reduceɼ䋯ಘൺֱշ • ෆoverload ݱ༗తreduce, Ҽҝ type checker ။่ ௵
  36. SE-0172 ୞༗Ұᬑత Range • ݱࡏ • ະိ

  37. SE-0173 ৽⃧ MutableCollection.swapAt(_:_:) • ݱ༗త swap ༗ၷݸ inout ჩᏐɼᔒ༗ූ߹ Ownership

    తنଇ • ৽⃧Ұݸ༻index ိަ׵త swapAt(indexA, indexB)