Swift Weekly 2017-05-02

Swift Weekly 2017-05-02

3f7d9611fc919c98512b779cde637dfc?s=128

Johnlin

May 02, 2017
Tweet

Transcript

  1. 4.

    ఔࣜᛰ૬༰ੑଌࢼܥ౷ • Swift 4 త໨ඪ೭Ұੋཁࡏ Swift 3 ໛ࣜԼ޲Լ૬༰ɼ ໵बੋ㘸Swift 3

    తఔࣜᛰෆ༻मվबೳ៺᠃࢖༻ɻ • ҝྃ֬อ޲Լ૬༰తᜦఆੑɼCI ܥ౷။ࣗಈଌࢼ֤ വࣜݿత૬༰ੑɼแؚ Realm, Alamofire, Perfect, vapor ౳౳ɻ
  2. 5.

    Evolution • SE-0155 Enum case දࣔ๏ਖ਼نԽ • SE-0161 ߋ޷తKey Value

    Coding • SE-0162 ౟݅؅ཧث٬੍Խࢿྉᇄ݁ߏ • SE-0163 վྑࣈ۲ɿࢧԉCollection, C ૬༰ੑ • SE-0164 Protocol extension ෆೳ༻ final
  3. 6.

    SE-0155 Enum case දࣔ๏ਖ਼ن Խ • ݱࡏ Enum એࠂత case

    ଖመੋ༻ᔒ༗ඪតతTuple መ࡞తɼ೭ޙ။վ੒࿨Ұൠత class Ұᒬɻ • ॴҎ೭ޙ Enum ໵ՄҎ༗༬ઃᆴɼؐ༗ಉҰݸ ໊᜝ ୠෆಉඪតత൛ຊɻ • ୠੋჩᏐత࿩ Void ཁଧग़ိɻ
  4. 9.

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

    #keypath() ိදࣔɼ جຊबੋᱛᨽաతࣈ۲ɻ୞༗NSObject ࠽ೳ༻ • ৽⃧Ұݸ \.<path> తදࣔ๏ɼ౥഑ [keyPath: ] ࢖ ༻ɻ
  5. 15.

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

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

    SE-0164 Protocol extension ෆೳ༻ final • Protocol extension ຊိबෆೳඃվሜɼ༗ᔒ༗Ճ final

    ౎Ұᒬɻ • ೭ޙՃྃ final ब။༗ࡨޡɼෆա։ swift 3 ໛ࣜత࿩ ୞။༗ܯࠂɻ
  7. 17.

    Evolution • SE-0165 Ճڧ Dictionary ࿨ Set • SE-0166 ෧ଘᢛংྻԽ

    • SE-0167 ฤᛰث • SE-0168 ଟߦᏐతࣈ۲
  8. 18.

    SE-0165 Ճڧ Dictionary ࿨ Set • Dictionary ࿨ Set ༻ىိෆⴺ޷༻ɼڧԽྃԼ໘زᴍ

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

    SE-0165 Ճڧ Dictionary ࿨ Set • ኺ Array 㗞ੜ Dictionary

    • ݱࡏ୞ೳखಈ೺ Array ᫚੒ Dictionary ɼ೭ޙՄҎࣗ ಈ೺ tuple array ᫚੒ Dictionary
  10. 22.

    SE-0165 Ճڧ Dictionary ࿨ Set • Dictionary త mapValues •

    ݱࡏ୞ೳmap׬೭ޙ࠶खಈݐཱҰ࣍ Dictionaryɻ೭ ޙՄҎሣValue ၏ mapɻ
  11. 23.

    SE-0165 Ճڧ Dictionary ࿨ Set • Dictionary ࿨ Set త

    filter • ݱࡏ୞ೳfilter ׬೭ޙ࠶खಈݐཱҰ࣍ Dictionaryɻ೭ ޙՄҎ௚઀၏ filter ɼ။ճၚҰݸ Dictionaryɻ
  12. 24.
  13. 26.

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

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

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

    ࿨ collection type ౎ՄҎඃࣗಈ᫚ ׵ • ؐ༗Ұථ Foundation త class แؚ Date, URL ౳౳ • Codable ။࿨ NSKeyed[Un]Archiver ૬༰
  15. 31.

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

    NSNumber ڮ઀վળ • SE-0171 ༻ inout ိ reduce • SE-0172 ୞༗Ұᬑత Range • SE-0173 ৽⃧ MutableCollection.swapAt(_:_:)
  16. 32.

    SE-0169 ༏Խ private ࿨ extension ೭ؒత᮫܎ • ݱࡏprivate member ୞༗ࡏఆٛతׅᥒൣᅴ㚎࠽ೳ

    ଘऔɼಉҰݸ䈕Ҋ㚎ෆߦɼཁվ༻fileprivate • େՈ౎تᓣ༻extension ိఆٛfunctionɼ଄੒኷ଟ ෆඞཁత fileprivate • ೭ޙಉҰݸ䈕Ҋ㚎త extension ໵ՄҎଘऔ private member
  17. 34.

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

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

  18. 35.

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

    త reduceɼ䋯ಘൺֱշ • ෆoverload ݱ༗తreduce, Ҽҝ type checker ။่ ௵
  19. 37.