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

Swift Weekly 2017-05-02

Swift Weekly 2017-05-02

Johnlin

May 02, 2017
Tweet

More Decks by Johnlin

Other Decks in Programming

Transcript

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

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

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

    ଖመੋ༻ᔒ༗ඪតతTuple መ࡞తɼ೭ޙ။վ੒࿨Ұൠత class Ұᒬɻ • ॴҎ೭ޙ Enum ໵ՄҎ༗༬ઃᆴɼؐ༗ಉҰݸ ໊᜝ ୠෆಉඪតత൛ຊɻ • ୠੋჩᏐత࿩ Void ཁଧग़ိɻ
  4. SE-0161 ߋ޷తKey Value Coding • ݱࡏత key value coding ੋ༻

    #keypath() ိදࣔɼ جຊबੋᱛᨽաతࣈ۲ɻ୞༗NSObject ࠽ೳ༻ • ৽⃧Ұݸ \.<path> తදࣔ๏ɼ౥഑ [keyPath: ] ࢖ ༻ɻ
  5. SE-0163 վྑࣈ۲ɿࢧԉ Collection, C ૬༰ੑ • Swift 2 ೺ࣈ۲ᙛ collection

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

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

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

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

    • ݱࡏ୞ೳखಈ೺ Array ᫚੒ Dictionary ɼ೭ޙՄҎࣗ ಈ೺ tuple array ᫚੒ Dictionary
  10. SE-0165 Ճڧ Dictionary ࿨ Set • Dictionary త mapValues •

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

    filter • ݱࡏ୞ೳfilter ׬೭ޙ࠶खಈݐཱҰ࣍ Dictionaryɻ೭ ޙՄҎ௚઀၏ filter ɼ။ճၚҰݸ Dictionaryɻ
  12. SE-0166 ෧ଘᢛংྻԽ • ݱࡏ୞ೳᯪ NSCoder ိ၏ংྻԽɼॴҎ Struct ࿨ Enum ౎ෆೳඃংྻԽɻ

    • ။৽⃧ Encoder, Decoder, Encodable ࿨ Decodable protocolိ႔ཧংྻԽɼࢧԉ Class, Struct ࿨ Enum • ؐ༗ Codable protocol ୅දՄҎ᫚׵ग़ڈ࠶ճိ
  13. SE-0167 ฤᛰث • ఏڙၷछংྻԽతฤᛰثɼ json ࿨ plist • 㚎ݐతdata type

    ࿨ collection type ౎ՄҎඃࣗಈ᫚ ׵ • ؐ༗Ұථ Foundation త class แؚ Date, URL ౳౳ • Codable ။࿨ NSKeyed[Un]Archiver ૬༰
  14. Evolution • SE-0169 ༏Խ private ࿨ extension ೭ؒత᮫܎ • SE-0170

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

    ଘऔɼಉҰݸ䈕Ҋ㚎ෆߦɼཁվ༻fileprivate • େՈ౎تᓣ༻extension ိఆٛfunctionɼ଄੒኷ଟ ෆඞཁత fileprivate • ೭ޙಉҰݸ䈕Ҋ㚎త extension ໵ՄҎଘऔ private member
  16. SE-0170 NSNumber ڮ઀վળ • ্໘తᆴੋ -1 (0x11111111) • ೭ޙ༻ as?

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

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

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