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

Swift Weekly 2017-03-07

Johnlin
March 07, 2017

Swift Weekly 2017-03-07

Johnlin

March 07, 2017
Tweet

More Decks by Johnlin

Other Decks in Programming

Transcript

  1. From the core • swift-evolution ࿨ swift-users ။ඃኺ mailing list

    ൖ ౸ Discourse ࿦ஃ • Swift 4 ։࢝ୈೋ֊୺։ᚙ • Swift 4 తᚙ෍ྲྀఔቮެ։
  2. swift-evolution ࿨ swift-users ။ඃ ኺ mailing list ൖ౸ Discourse ࿦ஃ

    • ༻࿦ஃൺֱ޷؅ཧ࿨፺ਘɻ • ။อཹemail໛ࣜɼDiscourse ՄҎ༻ email ᚙจ࿨ ճจ
  3. Swift 4 ։࢝ୈೋ֊୺։ᚙ • ߋ޷త String ʢ໨ඪੋ㐝ഊ Perl) • Integer

    Protocol • ڧԽ Collection • ڧԽ Genericʢᔟܕʣ
  4. Swift 4 తᚙ෍ྲྀఔቮެ։ • Swift 4 ޲Լࢧԉ Swift 3.1 ఔࣜᛰ

    • Swift 4 ՄҎ༻ Swift 3 త Package • ༬ܭ 2017 ೥ळఱᚙ෍
  5. Evolution • SE-0151 ౟݅؅ཧثࢦఆSwift ൛ຊ • SE-0152 ౟݅ࢦఆ౟݅؅ཧث൛ຊ • SE-0153

    ႔ཧ @NSCopying తෆҰகߦҝ • SE-0154 ሡ Dictionary త Keys ࿨ Values վ੒ಛ੡ త Collection
  6. SE-0152 ౟݅ࢦఆ౟݅؅ཧث൛ ຊ • ༻ swift package tools-version --set <value>

    ိઃఆ package త tools ൛ຊɼ໵ՄҎࡏ Package.swift ࠷ ্໘ଧ //swift-tools-version: 3.0.0 • ᔒઃత࿩༬ઃ 3.0.0 • ။޲Լ૬༰ • Өڹ Package.swift ՄҎࢧԉత֨ࣜ
  7. SE-0153 ႔ཧ @NSCopying త ෆҰகߦҝ • @NSCopy త Attribute ጯ֘။ሣ෺݅၏

    deep copyɼ 㗞ੜ৽త෺݅ɻ • Swift ᔒ㭎๏खಈࢦఆཁ༻ Attribute ؐੋ iVarɻ • ኺObj-c ትိత׳ྫੋࡏ init ཫ౎༻ iVarɼଖଞ஍ํ ༻ Attributeɻ • ॴҎࡏ init ཫ႔ཧ NSCopy త౦੢။ᆦᎃ
  8. SE-0153 ႔ཧ @NSCopying త ෆҰகߦҝ class Person : NSObject, NSCopying

    { var name:String var job:String init(name:String, job:String) { self.name=name self.job=job } func copy(with zone: NSZone? = nil) -> Any { let clone = Person.init(name: name, job: job) return clone } }
  9. SE-0153 ႔ཧ @NSCopying త ෆҰகߦҝ class Pet { @NSCopying var

    owner: Person init(owner:Person) { self.owner=owner } }
  10. SE-0153 ႔ཧ @NSCopying త ෆҰகߦҝ • ಁա compiler త ∍ຐ๏ɼ೗Ռ

    attribute ੋ @NSCopying ɼ बෆ༻ivar վ༻ attribute
  11. SE-0154 ሡ Dictionary త Keys ࿨ Values վ੒ಛ੡త Collection •

    ݱࡏཁፙಛఆత key ଎౓኷ຫɻ • আඇ༻ಛఆతሜ๏࠽။շɻ • վ੒ಛ੡ collection ޙ଎౓။Ұᒬշ