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

Swift 4.2 はどのような進化をしているのか/whats-new-swift42

Swift 4.2 はどのような進化をしているのか/whats-new-swift42

iOSDC Japan 2018
https://iosdc.jp/2018/

Yusuke Hosonuma

August 31, 2018
Tweet

More Decks by Yusuke Hosonuma

Other Decks in Programming

Transcript

  1. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.2 ͸

    ͲͷΑ͏ͳਐԽΛ͍ͯ͠Δ͔ʁ 1 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. iOSDC JAPAN 2018 2018/08/31 (Fri) 
 Yusuke Hosonuma - DeNA SWET
  2. Favorite Kubernetes Rust Yusuke Hosonuma DeNA SWET - Software Engineer

    in Test - Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 3 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. @tobi462
  3. ࠷ۙɺ࡞ͬͨαʔϏε 4 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. ஥ؒͱҰॹʹ
  4. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 5 Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. CfPΛշదʹݕࡧ ؔ࿈Πϕϯτ΋ʂ
  5. Swift 4.2 ͷมߋ఺ 7 Copyright (C) DeNA Co.,Ltd. All Rights

    Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  6. Swift 4.2 ͷมߋ఺ 8 Copyright (C) DeNA Co.,Ltd. All Rights

    Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ͦΕ͚ͩ͡Ό෺଍Γͳ͍ʁ
  7. ͓͜ͱΘΓ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 11 Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. ͘͘͞͞ൃද͍͖ͯ͠·͢ 1SPQPTBMશ෦͸ಡΊͯ·ͤΜ Twitter ʹεϥΠυషΓ·ͨ͠ ิ଍πΠʔτେ׻ܴʂ
  8. Agenda Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 13 Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. History Swift 4.2 1 2 3 "1*ͷ௥Ճมߋ ݴޠ࢓༷ 4XJGU1BDLBHF.BOBHFS ൃද ·Ͱͷྺ࢙ 18ݸ͕࣮૷
  9. Agenda Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 14 Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.2 1 2 3 "1*ͷ௥Ճมߋ ݴޠ࢓༷ 4XJGU1BDLBHF.BOBHFS ͞Βͬͱ History ൃද ·Ͱͷྺ࢙
  10. Swift History 15 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  11. WWDC 2014 16 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  12. ·͔͞ͷ৽ݴޠ͕ൃදʂ 18 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. ୭΋༧૝ͯ͠ͳ͔ͬͨʂ
  13. Swift ൃද Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 19

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ߴ଎ Ϟμϯ ҆શ ΠϯλϥΫςΟϒ
  14. υΩϡϝϯτ 88%$ձ৔͸େ͖ͳഥख Swift Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    20 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Swift ൃද ࠷ॳ͔Β iOS։ൃऀ΋େ஫໨
  15. 22 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Swift 1.0 Swift 1.1 Swift 1.2 Swift 2.0 Swift 3.0 Swift 4.0 Swift 4.1 2014 - 09 10 2015 - 04 09 2016 - 09 2017 - 09 2018 - 03
  16. Swift 1.0 23 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  17. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 24 Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Swift 1.0 1st ϦϦʔεʂ CFUB൛ͷόάमਖ਼ɾ࢓༷มߋ ΞΫηεम০ࢠ beta 4
  18. Swift 1.1 25 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  19. 'BJMBCMF*OJUJBMJ[FS ΍͸ΓϏϧυ͕࣌ؒ௕͍ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 26

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Swift 1.1 ҆ఆੑͷ޲্ ͓ۚͰղܾʁ
  20. Swift 1.2 27 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  21. *GMFUͷෳ਺αϙʔτ TUBUJDએݴɹɹBT ɹɹBT Ϗϧυͷߴ଎Խ Copyright (C) DeNA Co.,Ltd. All Rights

    Reserved. 28 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Swift 1.2 େ෯ͳػೳ௥Ճ ࠩ෼Ϗϧυʂ
  22. Swift 2.0 29 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  23. HVBSEMFU ྫ֎ϋϯυϦϯάʢUSZDBUDIʣ 1SPUPDPMFYUFOTJPOT Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    30 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Swift 2.0 ΦʔϓϯιʔεԽΛ༧ࠂ Protocol Oriented Programming
  24. Swift 3.0 31 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  25. "1*ΨΠυϥΠϯ $ݴޠελΠϧGPSจͷഇࢭ 4XJGU1BDLBHF.BOBHFS Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    32 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Swift 3.0 ഁյతͳ࢓༷มߋʢͲͬ͞Γʣ ໋໊نଇͷશ໘ݟ௚͠
  26. Swift 4.0 33 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  27. $PEBCMF ώΞυΩϡϝϯτ จࣈྻͷίϨΫγϣϯԽ͕෮׆ Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    34 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.0 ศརͳػೳ͕ଓʑͱ ษڧձͰେਓؾʂ
  28. Swift 4.1 35 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  29. $POEJUJPOBMDPOGPSNBODFT ࠶ؼతͳϓϩτίϧ੍໿ &RVBUBCMF)BTIBCMFͷ҉໧࣮૷ Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    36 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.1 ܕγεςϜͳͲͷਐԽ ଴๬ͷػೳ
  30. Swift ͬͯ 39 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  31. Swift … ഁյతͳ࢓༷มߋͷ࿈ଓ όʔδϣϯҧ͍ͷωοτهࣄ Ԇظ͠ଓ͚Δ"#*҆ఆԽ Copyright (C) DeNA Co.,Ltd. All

    Rights Reserved. 40 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ͳΜ͔ͩπϥΠ…
  32. ͢΂ͯ͸ཧ૝ͷ ϓϩάϥϛϯάݴޠͷͨΊʁ 42 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ௧Έແ͠ͰਐԽͳͲग़དྷͳ͍ʂ
  33. What’s Swift 4.2 ? 43 Copyright (C) DeNA Co.,Ltd. All

    Rights Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  34. Agenda Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 44 Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.2 ຊ୊ 1 2 3 "1*ͷ௥Ճมߋ ݴޠ࢓༷ 4XJGU1BDLBHF.BOBHFS History ൃද ·Ͱͷྺ࢙
  35. Swift 4.2 ͷ֓ཁ 45 Copyright (C) DeNA Co.,Ltd. All Rights

    Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  36. 9DPEF ഁյతͳ࢓༷มߋ͸Θ͔ͣ ݴޠͱͯ͠ॱ౰ͳόʔδϣϯΞοϓ Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    46 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.2 ͷ֓ཁ ࠓ͸ beta 6 ͱ͍͏ҹ৅
  37. 1 47 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.2 API ͷ௥Ճ / มߋ
  38. 48 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. SE-0197 SE-0199 SE-0202 SE-0204 SE-0205 SE-0207 SE-0210 Adding in-place removeAll(where:) to the Standard Library Adding toggle to Bool Random Unification Add last(where:) and lastIndex(where:) Methods withUnsafePointer(to:_:) and withUnsafeBytes(of:_:) for immutable values Add an allSatisfy algorithm to Sequence Add an offset(of:) method to MemoryLayout API ͷ௥Ճ / มߋ ̓ͭ
  39. Random Unification 49 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved. SE-0202
  40. 50 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. 4XJGUඪ४ͷϥϯμϜ஋ੜ੒"1*͕௥Ճ -JOVY؀ڥͰ΋ར༻Ͱ͖ΔΑ͏ʹ ൣғ͔Βੜ੒ ഑ྻ͔ΒϥϯμϜͰऔΓग़͠ ഑ྻΛγϟοϑϧ ֓ཁ Random Unification SE-0202
  41. 1. ൣғ͔Βੜ੒ 51 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  42. 52 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. import Foundation Int(arc4random_uniform(UInt32(10))) // 0 ʙ 9 arc4random_uniform(UInt32(2)) == 0 ? true : false // true | false ൣғʢ3BOHFʣ͔Βੜ੒ Random Unification SE-0202 Swift 4.1
  43. 53 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. import Foundation Int(arc4random_uniform(UInt32(10))) // 0 ʙ 9 arc4random_uniform(UInt32(2)) == 0 ? true : false // true | false ൣғʢ3BOHFʣ͔Βੜ੒ Random Unification SE-0202 Swift 4.1 'PVOEBUJPO͕ඞཁ
  44. 54 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. import Foundation Int(arc4random_uniform(UInt32(10))) // 0 ʙ 9 arc4random_uniform(UInt32(2)) == 0 ? true : false // true | false ൣғʢ3BOHFʣ͔Βੜ੒ Random Unification SE-0202 Swift 4.1 4XJGUZͰͳ͍"1*
  45. 55 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. import Foundation Int(arc4random_uniform(UInt32(10))) // 0 ʙ 9 arc4random_uniform(UInt32(2)) == 0 ? true : false // true | false Int.random(in: 0..<10) // 0 ʙ 9 Bool.random() // true | false ൣғʢ3BOHFʣ͔Βੜ੒ Random Unification SE-0202 Swift 4.1 Swift 4.2
  46. 56 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. import Foundation Int(arc4random_uniform(UInt32(10))) // 0 ʙ 9 arc4random_uniform(UInt32(2)) == 0 ? true : false // true | false Int.random(in: 0..<10) // 0 ʙ 9 Bool.random() // true | false ൣғʢ3BOHFʣ͔Βੜ੒ Random Unification SE-0202 Swift 4.1 'PVOEBUJPOͷJNQPSU΋ෆཁʹ Swift 4.2
  47. 58 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [1, 2, 3, 4, 5] if let x = xs.randomElement() { print(x) } else { print("Array is empty.") } ഑ྻ͔ΒϥϯμϜʹཁૉΛऔಘ Random Unification SE-0202 Swift 4.2
  48. 59 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [1, 2, 3, 4, 5] if let x = xs.randomElement() { print(x) } else { print("Array is empty.") } ϥϯμϜͰཁૉΛऔಘ ഑ྻ͔ΒϥϯμϜʹཁૉΛऔಘ Random Unification SE-0202 Swift 4.2
  49. 60 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [1, 2, 3, 4, 5] if let x = xs.randomElement() { print(x) } else { print("Array is empty.") } ഑ྻ͔ΒϥϯμϜʹཁૉΛऔಘ Random Unification SE-0202 ഑ྻ͕ۭͷ৔߹͸OJM Swift 4.2
  50. 62 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [1, 2, 3, 4, 5] xs.shuffled() // [4, 5, 1, 2, 3] var ys = xs ys.shuffle() print(ys) // [3, 5, 4, 2, 1] ഑ྻΛγϟοϑϧ Random Unification SE-0202 Swift 4.2
  51. 63 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [1, 2, 3, 4, 5] xs.shuffled() // [4, 5, 1, 2, 3] var ys = xs ys.shuffle() print(ys) // [3, 5, 4, 2, 1] ഑ྻΛγϟοϑϧ Random Unification SE-0202 ৽͍͠഑ྻΛฦ͢TIV⒐FE Swift 4.2
  52. 64 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [1, 2, 3, 4, 5] xs.shuffled() // [4, 5, 1, 2, 3] var ys = xs ys.shuffle() print(ys) // [3, 5, 4, 2, 1] ഑ྻΛγϟοϑϧ Random Unification SE-0202 มߋ͢ΔTIV⒐F Swift 4.2
  53. 65 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Adding toggle to Bool SE-0199
  54. 66 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ֓ཁ Adding toggle to Bool SE-0199 #PPM஋ͷ൓సϝιουͷ௥Ճ #PPM • UPHHMF
  55. 67 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. view.isHidden = !view.isHidden #PPM஋Λ൓స Adding toggle to Bool SE-0199 Swift 4.1
  56. 68 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. view.isHidden = !view.isHidden #PPM஋Λ൓స Adding toggle to Bool SE-0199 Swift 4.1 ൱ఆԋࢉࢠͰ൓సͯ͠୅ೖ
  57. 69 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. view.isHidden = !view.isHidden view.isHidden.toggle() #PPM஋Λ൓స Adding toggle to Bool SE-0199 Swift 4.1 Swift 4.2
  58. 70 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. view.isHidden = !view.isHidden view.isHidden.toggle() #PPM஋Λ൓స Adding toggle to Bool SE-0199 Swift 4.1 νΣʔϯͷ్தʹ0QUJPOBM͕͋Δ৔߹͸͞Βʹศར Swift 4.2
  59. 72 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. extension Bool { @inlinable public mutating func toggle() { self = !self } } ࣮૷͸ʁ Adding toggle to Bool SE-0199
  60. 73 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. extension Bool { @inlinable public mutating func toggle() { self = !self } } ࣮૷͸ʁ Adding toggle to Bool SE-0199 ΠϯϥΠϯԽ͞ΕΔͷͰύϑΥʔϚϯε௿Լ΋৺഑ͳ͍
  61. 74 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Add last(where:) and lastIndex(where:) Methods SE-0204
  62. 75 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ຤ඌ͔ΒཁૉΛ୳͢ϝιου͕௥Ճ 4FRVFODF • MBTU XIFSF  • MBTU*OEFY XIFSF  • JOEFY XIFSF ➔pSTU*OEFY XIFSF ֓ཁ Add last(where:) and lastIndex(where:) Methods SE-0204 Ұ؏ੑΛ࣋ͨͤΔͨΊมߋ
  63. 76 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [1, 2, 3, 2, 4] (xs.reversed().firstIndex(of: 2)?.base).map { xs.index(before: $0) } // Optional(3) ྫɿ࠷ޙͷʮʯͷ*OEFYΛऔಘ Add last(where:) and lastIndex(where:) Methods SE-0204 Swift 4.1
  64. 77 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [1, 2, 3, 2, 4] (xs.reversed().firstIndex(of: 2)?.base).map { xs.index(before: $0) } // Optional(3)  ൓సͯ͠ʢSFWFSTFEʣ  ࠷ॳͷ*OEFYͷCBTFΛऔಘͯ͠  JOEFY CFGPSF Ͱຊདྷͷ*OEFYʹ ྫɿ࠷ޙͷʮʯͷ*OEFYΛऔಘ Add last(where:) and lastIndex(where:) Methods SE-0204 Swift 4.1 ͱʹ͔͘໘౗…
  65. 78 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [1, 2, 3, 2, 4] (xs.reversed().firstIndex(of: 2)?.base).map { xs.index(before: $0) } // Optional(3) xs.lastIndex(of: 2) // Optional(3) Swift 4.1 Swift 4.2 ྫɿ࠷ޙͷʮʯͷ*OEFYΛऔಘ Add last(where:) and lastIndex(where:) Methods SE-0204
  66. 79 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [1, 2, 3, 2, 4] (xs.reversed().firstIndex(of: 2)?.base).map { xs.index(before: $0) } // Optional(3) xs.lastIndex(of: 2) // Optional(3) Swift 4.1 ؆ܿɾ໌ྎʂ Swift 4.2 ྫɿ࠷ޙͷʮʯͷ*OEFYΛऔಘ Add last(where:) and lastIndex(where:) Methods SE-0204
  67. 80 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Add an allSatisfy algorithm to Sequence SE-0207
  68. 81 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ͢΂ͯͷཁૉ͕৚݅Λຬ͔ͨ͢൑ఆ͢Δ"1* 4FRVFODF • BMM4BUJTGZ QSFDPOEJUJPO #PPM ֓ཁ Add an allSatisfy algorithm to Sequence SE-0207
  69. 82 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [2, 4, 6, 8] !xs.contains { $0 % 2 != 0 } // true ྫɿ഑ྻ಺ͷ͢΂ͯͷཁૉ͕ۮ਺͔ʁ Add an allSatisfy algorithm to Sequence SE-0207 Swift 4.1
  70. 83 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [2, 4, 6, 8] !xs.contains { $0 % 2 != 0 } // true ྫɿ഑ྻ಺ͷ͢΂ͯͷཁૉ͕ۮ਺͔ʁ Add an allSatisfy algorithm to Sequence SE-0207 Swift 4.1 ۮ਺Ͱͳ͍ཁૉ͕
  71. let xs = [2, 4, 6, 8] !xs.contains { $0

    % 2 != 0 } // true 84 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ྫɿ഑ྻ಺ͷ͢΂ͯͷཁૉ͕ۮ਺͔ʁ Add an allSatisfy algorithm to Sequence SE-0207 Swift 4.1 ؚ·Ε͍ͯͳ͍͜ͱ
  72. 85 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [2, 4, 6, 8] !xs.contains { $0 % 2 != 0 } // true xs.allSatisfy { $0 % 2 == 0 } // true ྫɿ഑ྻ಺ͷ͢΂ͯͷཁૉ͕ۮ਺͔ʁ Add an allSatisfy algorithm to Sequence SE-0207 Swift 4.1 Swift 4.2
  73. 86 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs = [2, 4, 6, 8] !xs.contains { $0 % 2 != 0 } // true xs.allSatisfy { $0 % 2 == 0 } // true ྫɿ഑ྻ಺ͷ͢΂ͯͷཁૉ͕ۮ਺͔ʁ Add an allSatisfy algorithm to Sequence SE-0207 Swift 4.1 ؆ܿɾ໌ྎʂ Swift 4.2
  74. 87 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Adding in-place removeAll(where:) to the Standard Library SE-0197
  75. 88 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ৚݅Λຬͨ͢ཁૉΛ͢΂ͯআڈ͢Δ"1* 3BOHF3FQMBDFBCMF$PMMFDUJPO • SFNPWF"MM XIFSF ֓ཁ Adding in-place removeAll(where:) to the Standard Library SE-0197 ύϑΥʔϚϯε΋ྑ͍ʢin-placeʣ
  76. 89 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. var xs = [1, 2, 3, 4] xs = xs.filter { $0 % 2 != 0 } // [1, 3] ྫɿ഑ྻ͔Βۮ਺Λ͢΂ͯऔΓআ͘ Adding in-place removeAll(where:) to the Standard Library SE-0197 Swift 4.1
  77. 90 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. var xs = [1, 2, 3, 4] xs = xs.filter { $0 % 2 != 0 } // [1, 3] ྫɿ഑ྻ͔Βۮ਺Λ͢΂ͯऔΓআ͘ Adding in-place removeAll(where:) to the Standard Library SE-0197 Swift 4.1 ۮ਺Ͱͳ͍ཁૉΛ
  78. 91 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. var xs = [1, 2, 3, 4] xs = xs.filter { $0 % 2 != 0 } // [1, 3] ྫɿ഑ྻ͔Βۮ਺Λ͢΂ͯऔΓআ͘ Adding in-place removeAll(where:) to the Standard Library SE-0197 Swift 4.1 औΓग़ͯ͠࠶୅ೖ
  79. 92 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. xs.removeAll { $0 % 2 == 0 } // [1, 3] var xs = [1, 2, 3, 4] xs = xs.filter { $0 % 2 != 0 } // [1, 3] ྫɿ഑ྻ͔Βۮ਺Λ͢΂ͯऔΓআ͘ Adding in-place removeAll(where:) to the Standard Library SE-0197 Swift 4.1 Swift 4.2
  80. 93 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. xs.removeAll { $0 % 2 == 0 } // [1, 3] var xs = [1, 2, 3, 4] xs = xs.filter { $0 % 2 != 0 } // [1, 3] ྫɿ഑ྻ͔Βۮ਺Λ͢΂ͯऔΓআ͘ Adding in-place removeAll(where:) to the Standard Library SE-0197 Swift 4.1 ؆ܿɾ໌ྎʂ Swift 4.2
  81. 94 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. withUnsafePointer(to:_:) and withUnsafeBytes(of:_:) for immutable values SE-0205
  82. 95 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. MFUͳ஋ʹରͯ͠΋௚઀ݺͼग़ͤΔΑ͏ʹ XJUI6OTBGF1PJOUFS UP@  XJUI6OTBGF#ZUFT PG@ ֓ཁ withUnsafePointer(to:_:) and withUnsafeBytes(of:_:) for immutable values SE-0205
  83. 96 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let x = 42 var copy = x withUnsafePointer(to: &copy) { pointer in print(pointer.pointee) // 42 } XJUI6OTBGF1PJOUFS withUnsafePointer(to:_:) and withUnsafeBytes(of:_:) for immutable values SE-0205 Swift 4.1
  84. 97 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let x = 42 var copy = x withUnsafePointer(to: &copy) { pointer in print(pointer.pointee) // 42 } XJUI6OTBGF1PJOUFS withUnsafePointer(to:_:) and withUnsafeBytes(of:_:) for immutable values SE-0205 Swift 4.1 WBSʹ୅ೖ͠௚ͯ͠
  85. 98 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let x = 42 var copy = x withUnsafePointer(to: &copy) { pointer in print(pointer.pointee) // 42 } XJUI6OTBGF1PJOUFS withUnsafePointer(to:_:) and withUnsafeBytes(of:_:) for immutable values SE-0205 Swift 4.1 ࢀরΛ౉͢
  86. 99 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let x = 42 var copy = x withUnsafePointer(to: &copy) { pointer in print(pointer.pointee) // 42 } withUnsafePointer(to: x) { pointer in print(pointer.pointee) // 42 } XJUI6OTBGF1PJOUFS withUnsafePointer(to:_:) and withUnsafeBytes(of:_:) for immutable values SE-0205 Swift 4.1 Swift 4.2
  87. 100 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let x = 42 var copy = x withUnsafePointer(to: &copy) { pointer in print(pointer.pointee) // 42 } withUnsafePointer(to: x) { pointer in print(pointer.pointee) // 42 } XJUI6OTBGF1PJOUFS withUnsafePointer(to:_:) and withUnsafeBytes(of:_:) for immutable values SE-0205 Swift 4.1 ௚઀YΛ౉ͤΔΑ͏ʹ Swift 4.2
  88. 101 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Add an offset(of:) method to MemoryLayout SE-0210
  89. 102 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ࢦఆͨ͠ΩʔύεͷϝϞϦΦϑηοτΛऔಘ͢Δ"1* .FNPSZ-BZPVU • P⒎TFU PG ֓ཁ Add an offset(of:) method to MemoryLayout SE-0210 OpenGL ͳͲͰศརʢΒ͍͠ʣ
  90. 103 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. struct Point { var x: Int var y: Int } struct Circle { var center: Point var radius: Int } MemoryLayout.offset(of: \Circle.center.x) // 0 MemoryLayout.offset(of: \Circle.center.y) // 8 MemoryLayout.offset(of: \Circle.radius) // 16 ϝϞϦͷΦϑηοτΛऔಘ Add an offset(of:) method to MemoryLayout SE-0210 Swift 4.2
  91. 104 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. struct Point { var x: Int var y: Int } struct Circle { var center: Point var radius: Int } MemoryLayout.offset(of: \Circle.center.x) // 0 MemoryLayout.offset(of: \Circle.center.y) // 8 MemoryLayout.offset(of: \Circle.radius) // 16 ϝϞϦͷΦϑηοτΛऔಘ Add an offset(of:) method to MemoryLayout SE-0210 ߏ଄ମ Swift 4.2
  92. 105 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. struct Point { var x: Int var y: Int } struct Circle { var center: Point var radius: Int } MemoryLayout.offset(of: \Circle.center.x) // 0 MemoryLayout.offset(of: \Circle.center.y) // 8 MemoryLayout.offset(of: \Circle.radius) // 16 ϝϞϦͷΦϑηοτΛऔಘ Add an offset(of:) method to MemoryLayout SE-0210 ,FZ1BUIͰϓϩύςΟΛࢦఆ Swift 4.2
  93. 106 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. struct Point { var x: Int var y: Int } struct Circle { var center: Point var radius: Int } MemoryLayout.offset(of: \Circle.center.x) // 0 MemoryLayout.offset(of: \Circle.center.y) // 8 MemoryLayout.offset(of: \Circle.radius) // 16 ϝϞϦͷΦϑηοτΛऔಘ Add an offset(of:) method to MemoryLayout SE-0210 Swift 4.2 .FNPSZ-BZPVUP⒎TFUʹ౉͢
  94. 107 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. struct Point { var x: Int var y: Int } struct Circle { var center: Point var radius: Int } MemoryLayout.offset(of: \Circle.center.x) // 0 MemoryLayout.offset(of: \Circle.center.y) // 8 MemoryLayout.offset(of: \Circle.radius) // 16 ← 0 byte ϝϞϦͷΦϑηοτΛऔಘ Add an offset(of:) method to MemoryLayout SE-0210 Point x y radius Int Int Int Circle ← 8 byte ← 16 byte
  95. 2 108 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.2 ݴޠ࢓༷
  96. 109 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. SE-0054 SE-0143 SE-0193 SE-0194 SE-0195 SE-0196 SE-0206 SE-0212 Abolish ImplicitlyUnwrappedOptional type Conditional conformances Cross-module inlining and specialization Derived Collection of Enum Cases Introduce User-defined "Dynamic Member Lookup" Types Compiler Diagnostic Directives Hashable Enhancements Compiler Version Directive ݴޠ࢓༷ 8ͭ
  97. 110 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. SE-0206 Hashable Enhancements
  98. 111 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. )BTIBCMFϓϩτίϧͷ࣮૷ํ๏͕มߋ 4XJGU • IBTI7BMVF  4XJGU • IBTI JOUPIBTIFSJOPVU)BTIFS ֓ཁ Hashable Enhancements SE-0206
  99. 112 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. )BTIBCMFϓϩτίϧͷ࣮૷ํ๏͕มߋ 4XJGU • IBTI7BMVF  4XJGU • IBTI JOUPIBTIFSJOPVU)BTIFS ֓ཁ Hashable Enhancements SE-0206
  100. 113 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. class Person: Hashable { let name: String let age: Int init(name: String, age: Int) { self.name = name self.age = age } static func == (lhs: Person, rhs: Person) -> Bool { return lhs.name == rhs.name && lhs.age == rhs.age } } ྫɿ1FSTPOΫϥεʹ)BTIBCMFΛద߹ Hashable Enhancements SE-0206 Swift 4.2
  101. 114 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. class Person: Hashable { let name: String let age: Int init(name: String, age: Int) { self.name = name self.age = age } static func == (lhs: Person, rhs: Person) -> Bool { return lhs.name == rhs.name && lhs.age == rhs.age } } ྫɿ1FSTPOΫϥεʹ)BTIBCMFΛద߹ Hashable Enhancements SE-0206 &RVBUBCMF΁ͷ४ڌ΋ඞཁ Swift 4.2
  102. 115 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. extension Person: Hashable { var hashValue: Int { return name.hashValue ^ age.hashValue &* 42 } } Swift 4.1 ྫɿ1FSTPOΫϥεʹ)BTIBCMFΛద߹ Hashable Enhancements SE-0206
  103. extension Person: Hashable { var hashValue: Int { return name.hashValue

    ^ age.hashValue &* 42 } } 116 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.1 Hashable Enhancements SE-0206 ྫɿ1FSTPOΫϥεʹ)BTIBCMFΛద߹ ࣗલͰϋογϡ஋Λܭࢉ͢Δඞཁ͕͋ͬͨ
  104. extension Person: Hashable { var hashValue: Int { return name.hashValue

    ^ age.hashValue &* 42 } } 117 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. extension Person: Hashable { func hash(into hasher: inout Hasher) { hasher.combine(name) hasher.combine(age) } } ྫɿ1FSTPOΫϥεʹ)BTIBCMFΛద߹ Hashable Enhancements SE-0206 Swift 4.1 Swift 4.2
  105. extension Person: Hashable { var hashValue: Int { return name.hashValue

    ^ age.hashValue &* 42 } } 118 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. extension Person: Hashable { func hash(into hasher: inout Hasher) { hasher.combine(name) hasher.combine(age) } } ྫɿ1FSTPOΫϥεʹ)BTIBCMFΛద߹ Hashable Enhancements SE-0206 Swift 4.1 Swift 4.2 ϋογϡ஋Λܭࢉ͢ΔΦϒδΣΫτ
  106. extension Person: Hashable { var hashValue: Int { return name.hashValue

    ^ age.hashValue &* 42 } } 119 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. extension Person: Hashable { func hash(into hasher: inout Hasher) { hasher.combine(name) hasher.combine(age) } } ྫɿ1FSTPOΫϥεʹ)BTIBCMFΛద߹ Hashable Enhancements SE-0206 Swift 4.1 DPNCJOFΛݺΜͰ͍͚͹0, Swift 4.2
  107. 120 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Derived Collection of Enum Cases SE-0194
  108. 121 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. &OVNͷDBTF͕ྻڍͰ͖ΔΑ͏ʹ $BTF*UFSBCMFϓϩτίϧΛ࣮૷ • ࣗ෼ͰΧελϚΠζ΋Մೳ ֓ཁ Derived Collection of Enum Cases SE-0194
  109. Swift 4.1 ͷ৔߹ 122 Copyright (C) DeNA Co.,Ltd. All Rights

    Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  110. 123 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. enum Signal { case blue case yellow case red } extension Signal { static var all: [Signal] { return [.blue, .yellow, .red] } static var count: Int { return all.count } } Signal.all // [.blue, .yellow, .red] Signal.all.count // 3 FOVNͷྻڍʢ4XJGUʣ Derived Collection of Enum Cases SE-0194 Swift 4.1
  111. 124 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. enum Signal { case blue case yellow case red } extension Signal { static var all: [Signal] { return [.blue, .yellow, .red] } static var count: Int { return all.count } } Signal.all // [.blue, .yellow, .red] Signal.all.count // 3 FOVNͷྻڍʢ4XJGUʣ Derived Collection of Enum Cases SE-0194 BMMͱDPVOUΛࣗ෼Ͱ࣮૷ Swift 4.1
  112. 125 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. enum Signal { case blue case yellow case red } extension Signal { static var all: [Signal] { return [.blue, .yellow, .red] } static var count: Int { return all.count } } Signal.all // [.blue, .yellow, .red] Signal.all.count // 3 FOVNͷྻڍʢ4XJGUʣ Derived Collection of Enum Cases SE-0194 मਖ਼࿙Ε͕ൃੜ͢ΔՄೳੑʜ Swift 4.1
  113. Swift 4.2 ͷ৔߹ 126 Copyright (C) DeNA Co.,Ltd. All Rights

    Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  114. 127 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. enum Signal: CaseIterable { case blue case yellow case red } Signal.allCases // [.blue, .yellow, .red] Signal.allCases.count // 3 FOVNͷྻڍʢ4XJGUʣ Derived Collection of Enum Cases SE-0194 Swift 4.2
  115. 128 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. enum Signal: CaseIterable { case blue case yellow case red } Signal.allCases // [.blue, .yellow, .red] Signal.allCases.count // 3 FOVNͷྻڍʢ4XJGUʣ Derived Collection of Enum Cases SE-0194 $BTF*UFSBCMFΛ࣮૷ Swift 4.2
  116. 129 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. enum Signal: CaseIterable { case blue case yellow case red } Signal.allCases // [.blue, .yellow, .red] Signal.allCases.count // 3 FOVNͷྻڍʢ4XJGUʣ Derived Collection of Enum Cases SE-0194 BMM$BTFTͰྻڍͰ͖Δʂ Swift 4.2
  117. 130 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. FOVNͷྻڍʢ4XJGUʣ Derived Collection of Enum Cases SE-0194 • FOVNʹBTTPDJBUFEWBMVFT͕͋Δ৔߹͸
 BMM$BTFTΛࣗ෼Ͱ࣮૷͢Δඞཁ͋Γ enum Signal: CaseIterable { case blue case yellow case red } Signal.allCases // [.blue, .yellow, .red] Signal.allCases.count // 3 Swift 4.2
  118. allCases ͷΧελϚΠζ 131 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  119. 132 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. enum Week: String, CaseIterable { case sunday, monday, tuesday, wednesday, thursday, friday, saturday static var allCases: [Week] { return [.sunday, .saturday] } } Week.allCases.map { $0.rawValue } // [.sunday, .saturday] BMM$BTFTͷΧελϚΠζ Derived Collection of Enum Cases SE-0194 Swift 4.2
  120. enum Week: String, CaseIterable { case sunday, monday, tuesday, wednesday,

    thursday, friday, saturday static var allCases: [Week] { return [.sunday, .saturday] } } Week.allCases.map { $0.rawValue } // [.sunday, .saturday] 133 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. BMM$BTFTͷΧελϚΠζ Derived Collection of Enum Cases SE-0194 BMM$BTFTΛ࣮૷ͯ͠഑ྻΛฦ͢ Swift 4.2
  121. 134 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Introduce User-defined ”Dynamic Member Lookup" Types SE-0195
  122. 135 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ίϯύΠϧஈ֊Ͱ֬ఆͯ͠ͳ͍ϓϩύςΟʹ
 υοτه๏ͰΞΫηεͰ͖Δ࢓૊Έ ֓ཁ Introduce User-defined "Dynamic Member Lookup" Types SE-0195 %ZOBNJD.FNCFS-PPLVQ • $ISJT-BUUOFS͕ఏҊɾ࣮૷ • +40/΍֎෦ݴޠͷݺͼग़͠ʢ''*ʣͳͲʹ
  123. 137 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. @dynamicMemberLookup struct Plist { let plist = [ “version" : "1.0" ] subscript(dynamicMember key: String) -> String { return plist[key] ?? "-" } } let plist = Plist() plist.version // 1.0 plist.name // - ྫɿQMJTUʹ҆શʹΞΫηε Introduce User-defined "Dynamic Member Lookup" Types SE-0195 Swift 4.2
  124. 138 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. @dynamicMemberLookup struct Plist { let plist = [ “version" : "1.0" ] subscript(dynamicMember key: String) -> String { return plist[key] ?? "-" } } let plist = Plist() plist.version // 1.0 plist.name // - ྫɿQMJTUʹ҆શʹΞΫηε Introduce User-defined "Dynamic Member Lookup" Types SE-0195 ଐੑΛఆٛ Swift 4.2
  125. 139 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. @dynamicMemberLookup struct Plist { let plist = [ “version" : "1.0" ] subscript(dynamicMember key: String) -> String { return plist[key] ?? "-" } } let plist = Plist() plist.version // 1.0 plist.name // - ྫɿQMJTUʹ҆શʹΞΫηε Introduce User-defined "Dynamic Member Lookup" Types SE-0195 EZOBNJD.FNCFS Swift 4.2
  126. 140 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. @dynamicMemberLookup struct Plist { let plist = [ “version" : "1.0" ] subscript(dynamicMember key: String) -> String { return plist[key] ?? "-" } } let plist = Plist() plist.version // 1.0 plist.name // - ྫɿQMJTUʹ҆શʹΞΫηε Introduce User-defined "Dynamic Member Lookup" Types SE-0195 ରԠ͢ΔΩʔ͕ແ͔ͬͨΒσϑΥϧτ஋ Swift 4.2
  127. 141 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. @dynamicMemberLookup struct Plist { let plist = [ “version" : "1.0" ] subscript(dynamicMember key: String) -> String { return plist[key] ?? "-" } } let plist = Plist() plist.version // 1.0 plist.name // - ྫɿQMJTUʹ҆શʹΞΫηε Introduce User-defined "Dynamic Member Lookup" Types SE-0195 ϓϩύςΟͷΑ͏ʹΞΫηεͰ͖Δ Swift 4.2
  128. ྫɿPython ࿈ܞ 142 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Proposal ΑΓൈਮ
  129. Swift 4.1 143 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  130. 144 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. // import pickle let pickle = Python.get(member: "import")("pickle") // file = open(filename) let file = Python.get(member: "open")(filename) // blob = file.read() let blob = file.get(member: "read")() // result = pickle.loads(blob) let result = pickle.get(member: "loads")(blob) 4XJGU Introduce User-defined "Dynamic Member Lookup" Types SE-0195
  131. 145 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. // import pickle let pickle = Python.get(member: "import")("pickle") // file = open(filename) let file = Python.get(member: "open")(filename) // blob = file.read() let blob = file.get(member: "read")() // result = pickle.loads(blob) let result = pickle.get(member: "loads")(blob) 4XJGU Introduce User-defined "Dynamic Member Lookup" Types SE-0195 ϝιουͳͲΛ͢΂ͯจࣈྻͰࢦఆ
  132. Swift 4.2 146 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  133. 147 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. // import pickle let pickle = Python.import("pickle") // file = open(filename) let file = Python.open(filename) // blob = file.read() let blob = file.read() // result = pickle.loads(blob) let result = pickle.loads(blob) 4XJGU Introduce User-defined "Dynamic Member Lookup" Types SE-0195
  134. 148 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. // import pickle let pickle = Python.import("pickle") // file = open(filename) let file = Python.open(filename) // blob = file.read() let blob = file.read() // result = pickle.loads(blob) let result = pickle.loads(blob) 4XJGU Introduce User-defined "Dynamic Member Lookup" Types SE-0195 ݩͷ1ZUIPOίʔυͱ΄΅ಉ͡ʹ
  135. 149 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Abolish ImplicitlyUnwrappedOptional type SE-0054
  136. 150 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. *60ܕɹ➔ɹ*60ଐੑ *NQMJDJUMZ6OXSBQQFE0QUJPOBMܕ • ҉໧తΞϯϥοϓܕʢFY4USJOHʣ • 4XJGUY͔Β։࢝͞Εͨ • 0QUJPOBMܕʹ౷Ұ ֓ཁ Abolish ImplicitlyUnwrappedOptional type SE-0054 4.2 Ͱ׬શഇࢭʂ
  137. 151 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. *60ܕɹ➔ɹ*60ଐੑ ϝϦοτ • ίϯύΠϥ࣮૷͕γϯϓϧʹͳΔ • 4XJGUར༻ऀʹͱͬͯ͸΄΅Өڹ͕ͳ͍ ֓ཁ Abolish ImplicitlyUnwrappedOptional type SE-0054 Β͍͠
  138. [Int!] ͷܕ͸Կ͔ʁ 152 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Λௐ΂ͯΈΔ
  139. 153 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs: [Int!] = [1, 2, 3] type(of: xs) // Array<ImplicitlyUnwrappedOptional<Int>>.Type <*OU>ͷܕ͸Կ͔ʁ Abolish ImplicitlyUnwrappedOptional type SE-0054 Swift 4.1
  140. 154 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs: [Int!] = [1, 2, 3] type(of: xs) // Array<ImplicitlyUnwrappedOptional<Int>>.Type <*OU>ͷܕ͸Կ͔ʁ Abolish ImplicitlyUnwrappedOptional type SE-0054 Swift 4.1 *NQMJDJUMZ6OXSBQQFE0QUJPOBM*OU
  141. 155 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs: [Int!] = [1, 2, 3] type(of: xs) // Array<ImplicitlyUnwrappedOptional<Int>>.Type type(of: xs) // Array<Optional<Int>>.Type <*OU>ͷܕ͸Կ͔ʁ Abolish ImplicitlyUnwrappedOptional type SE-0054 Swift 4.1 Swift 4.2
  142. 156 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs: [Int!] = [1, 2, 3] type(of: xs) // Array<ImplicitlyUnwrappedOptional<Int>>.Type type(of: xs) // Array<Optional<Int>>.Type <*OU>ͷܕ͸Կ͔ʁ Abolish ImplicitlyUnwrappedOptional type SE-0054 Swift 4.1 0QUJPOBM*OU Swift 4.2
  143. 157 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let xs: [Int!] = [1, 2, 3] type(of: xs) // Array<ImplicitlyUnwrappedOptional<Int>>.Type type(of: xs) // Array<Optional<Int>>.Type <*OU>ͷܕ͸Կ͔ʁ Abolish ImplicitlyUnwrappedOptional type SE-0054 Swift 4.1 Swift 4.2 • ɹ*NQMJDJUMZ6OXSBQQFE0QUJPOBM*OU • ɹ0QUJPOBM*OU
  144. IUO ଐੑͱ͸ʁ 158 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  145. 159 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. @implicitlyUnwrappedOptional let xs: Int? = 42 *60ଐੑͱ͸ʁ Abolish ImplicitlyUnwrappedOptional type SE-0054 Swift 4.2
  146. 160 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. @implicitlyUnwrappedOptional let xs: Int? = 42 *60ଐੑͱ͸ʁ Abolish ImplicitlyUnwrappedOptional type SE-0054 ͜͏͍͏ଐੑ͕෇༩͞Εͯ Swift 4.2
  147. 161 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. @implicitlyUnwrappedOptional let xs: Int? = 42 *60ଐੑͱ͸ʁ Abolish ImplicitlyUnwrappedOptional type SE-0054 ܕ͸0QUJPOBM*OU Swift 4.2
  148. 162 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. @implicitlyUnwrappedOptional let xs: Int? = 42 *60ଐੑͱ͸ʁ Abolish ImplicitlyUnwrappedOptional type SE-0054 ίϯύΠϥ಺෦ଐੑͳͷͰఆٛෆՄ Swift 4.2
  149. 163 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Conditional conformances SE-0143
  150. 164 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ৚݅෇͖ͷϓϩτίϧద߹ 4XJGUɹಋೖ 4XJGUɹվળ • ࣮ߦ࣌ͷϓϩτίϧద߹൑ఆ • ഑ྻ΍σΟΫγϣφϦ͕)BTIBCMFʹద߹ ֓ཁ Conditional conformances SE-0143
  151. 165 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. $POEJUJPOBMDPOGPSNBODFTʁ
  152. 166 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. extension Array: Equatable where Element: Equatable { } $POEJUJPOBM$POGPSNBODFT Conditional conformances SE-0143 Swift 4.2
  153. 167 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. extension Array: Equatable where Element: Equatable { } $POEJUJPOBM$POGPSNBODFT Conditional conformances SE-0143 ཁૉͷܕ͕&RVBUBCMFͳ৔߹ʹ Swift 4.2
  154. 168 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. extension Array: Equatable where Element: Equatable { } $POEJUJPOBM$POGPSNBODFT Conditional conformances SE-0143 "SSBZΛ&RVBUBCMFʹ४ڌ Swift 4.2
  155. 169 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. extension Array: Equatable where Element: Equatable { } $POEJUJPOBM$POGPSNBODFT Conditional conformances SE-0143 4XJGU͔ΒͰ͖ΔΑ͏ʹͳͬͨ Swift 4.2
  156. 170 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ࣮ߦ࣌ͷϓϩτίϧద߹൑ఆ 4.2 Ͱͷվળ ᶃ
  157. 171 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. protocol Drinkable { func drink() } struct Curry: Drinkable { func drink() { print("ΧϨʔ͸ҿΈ෺ʂ") } } extension Array: Drinkable where Element: Drinkable { func drink() { for x in self { x.drink() } } } ྫɿཁૉ͕ʮҿΊΔʯͳΒ͹શମͱͯ͠΋ʮҿΊΔʯ Conditional conformances SE-0143 Swift 4.2
  158. 172 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. protocol Drinkable { func drink() } struct Curry: Drinkable { func drink() { print("ΧϨʔ͸ҿΈ෺ʂ") } } extension Array: Drinkable where Element: Drinkable { func drink() { for x in self { x.drink() } } } ྫɿཁૉ͕ʮҿΊΔʯͳΒ͹શମͱͯ͠΋ʮҿΊΔʯ Conditional conformances SE-0143 ʮҿΊΔʯΛදݱ͢Δϓϩτίϧ
  159. 173 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. protocol Drinkable { func drink() } struct Curry: Drinkable { func drink() { print("ΧϨʔ͸ҿΈ෺ʂ") } } extension Array: Drinkable where Element: Drinkable { func drink() { for x in self { x.drink() } } } ྫɿཁૉ͕ʮҿΊΔʯͳΒ͹શମͱͯ͠΋ʮҿΊΔʯ Conditional conformances SE-0143 ΧϨʔ͸΋ͪΖΜʮҿΈ෺ʯ
  160. 174 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. protocol Drinkable { func drink() } struct Curry: Drinkable { func drink() { print("ΧϨʔ͸ҿΈ෺ʂ") } } extension Array: Drinkable where Element: Drinkable { func drink() { for x in self { x.drink() } } } ྫɿཁૉ͕ʮҿΊΔʯͳΒ͹શମͱͯ͠΋ʮҿΊΔʯ Conditional conformances SE-0143 ΧϨʔࡼ͕ʮҿΈ෺ʯͰ͋Ε͹ɺԿࡼͰ΋ʮҿΈ෺ʯ
  161. 175 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let items: Any = [Curry(), Curry(), Curry()] if let drinks = items as? Drinkable { drinks.drink() } ࣮ߦ࣌ʹ1SPUPDPM΁ͷ४ڌΛ൑ఆ Conditional conformances SE-0143 Swift 4.1
  162. 176 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let items: Any = [Curry(), Curry(), Curry()] if let drinks = items as? Drinkable { drinks.drink() } ࣮ߦ࣌ʹ1SPUPDPM΁ͷ४ڌΛ൑ఆ Conditional conformances SE-0143 Swift 4.1 <$VSSZ>Λ"OZͰએݴ
  163. 177 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let items: Any = [Curry(), Curry(), Curry()] if let drinks = items as? Drinkable { drinks.drink() } ࣮ߦ࣌ʹ1SPUPDPM΁ͷ४ڌΛ൑ఆ Conditional conformances SE-0143 Swift 4.1 %SJOLBCMFʹ४ڌ͍ͯ͠Δ͔ʁ
  164. 178 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let items: Any = [Curry(), Curry(), Curry()] if let drinks = items as? Drinkable { drinks.drink() } ࣮ߦ࣌ʹ1SPUPDPM΁ͷ४ڌΛ൑ఆ Conditional conformances SE-0143 Swift 4.1 warning: Swift runtime does not yet support dynamically querying conditional conformance Ͱ͸ਖ਼͘͠൑ఆͰ͖ͳ͔ͬͨ
  165. let items: Any = [Curry(), Curry(), Curry()] if let drinks

    = items as? Drinkable { drinks.drink() } // ΧϨʔ͸ҿΈ෺ʂ // ΧϨʔ͸ҿΈ෺ʂ // ΧϨʔ͸ҿΈ෺ʂ 179 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ࣮ߦ࣌ʹ1SPUPDPM΁ͷ४ڌΛ൑ఆ Conditional conformances SE-0143 Ͱ͸ҿΊΔΑ͏ʹʂ Swift 4.2
  166. 180 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ഑ྻͳͲ͕)BTIBCMFʹద߹ 4.2 Ͱͷվળ ᶄ
  167. 181 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. struct User: Hashable { var name: String var pets: [String] } ྫɿߏ଄ମ΁ͷ)BTIBCMFద߹ Conditional conformances SE-0143 Swift 4.1
  168. 182 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. struct User: Hashable { var name: String var pets: [String] } • <4USJOH>͕)BTIBCMFʹద߹͍ͯ͠ͳ͍ ྫɿߏ଄ମ΁ͷ)BTIBCMFద߹ Conditional conformances SE-0143 ❌ͩͱίϯύΠϧΤϥʔ Swift 4.1
  169. 183 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. struct User: Hashable { var name: String var pets: [String] } • ཁૉ͕)BTIBCMFͰ͋Ε͹ɺ഑ྻ΋)BTIBCMFʹద߹ • 0QUJPOBMɺ%JDUJPOBSZɺ3BOHFͳͲʹ͍ͭͯ΋ಉ༷ ྫɿߏ଄ମ΁ͷ)BTIBCMFద߹ Conditional conformances SE-0143 ⭕ͳΒ͜ͷ··Ͱ0,ʂ Swift 4.2
  170. 184 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Compiler Diagnostic Directives SE-0196
  171. 185 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ίϯύΠϧ࣌ʹܯࠂɾΤϥʔ͕ग़ͤΔσΟϨΫςΟϒ XBSOJOH FSSPS ֓ཁ Compiler Diagnostic Directives SE-0196 Objective-C ʹ͸͋ͬͨ
  172. 186 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. #warning("औಘͨ͠APIΩʔΛઃఆ͍ͯͩ͘͠͞ɻ") let apiKey = "" #error("ίʔϧόοΫURLΛઃఆ͢Δඞཁ͕͋Γ·͢ɻ") let callbackURL = "" ίϯύΠϥɾσΟϨΫςΟϒ Compiler Diagnostic Directives SE-0196 Swift 4.2
  173. 187 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. #warning("औಘͨ͠APIΩʔΛઃఆ͍ͯͩ͘͠͞ɻ") let apiKey = "" #error("ίʔϧόοΫURLΛઃఆ͢Δඞཁ͕͋Γ·͢ɻ") let callbackURL = "" ίϯύΠϥɾσΟϨΫςΟϒ Compiler Diagnostic Directives SE-0196 XBSOJOHͰܯࠂ Swift 4.2
  174. 188 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. #warning("औಘͨ͠APIΩʔΛઃఆ͍ͯͩ͘͠͞ɻ") let apiKey = "" #error("ίʔϧόοΫURLΛઃఆ͢Δඞཁ͕͋Γ·͢ɻ") let callbackURL = "" ίϯύΠϥɾσΟϨΫςΟϒ Compiler Diagnostic Directives SE-0196 FSSPSͰίϯύΠϧΤϥʔ Swift 4.2
  175. 189 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ίϯύΠϥɾσΟϨΫςΟϒ Compiler Diagnostic Directives SE-0196 #warning("औಘͨ͠APIΩʔΛઃఆ͍ͯͩ͘͠͞ɻ") let apiKey = "" #error("ίʔϧόοΫURLΛઃఆ͢Δඞཁ͕͋Γ·͢ɻ") let callbackURL = "" ར༻ྫɿαϯϓϧίʔυʹهड़ Swift 4.2
  176. 190 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. 9DPEFͰͷදࣔ Compiler Diagnostic Directives SE-0196 ௨ৗͷXBSOJOHFSSPSͱಉ༷
  177. 191 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Compiler Version Directive SE-0212
  178. 192 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. DPNQJMFSͷಋೖ 4XJGUίϯύΠϥͷόʔδϣϯͰ੾Γ෼͚ Compiler Version Directive SE-0212 ֓ཁ Swift όʔδϣϯ Ͱ͔͠ग़དྷͳ͔ͬͨ
  179. 193 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. TXJGU Ͱ SwiftίϯύΠϥ 4.1+ Λ൑ఆ
  180. 194 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. #if swift(>=4.1) || (swift(>=3.3) && !swift(>=4.0)) // ίϯύΠϥ 4.1 Ҏ্Ͱ༗ޮͳίʔυ #endif Compiler Version Directive SE-0212 4XJGUίϯύΠϥ Λ൑ఆ Swift --swift-version 3 --swift-version 4 4.0 3.2 4.0 4.1 3.3 4.1 4.2 3.4 4.1.5 Swift 4.2
  181. 195 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. #if swift(>=4.1) || (swift(>=3.3) && !swift(>=4.0)) // ίϯύΠϥ 4.1 Ҏ্Ͱ༗ޮͳίʔυ #endif Compiler Version Directive SE-0212 Swift --swift-version 3 --swift-version 4 4.0 3.2 4.0 4.1 3.3 4.1 4.2 3.4 4.1.5 4XJGUίϯύΠϥ Λ൑ఆ ޓ׵Ϟʔυ΋ؚΊͨ4XJGUόʔδϣϯͰ൑ఆ Swift 4.2
  182. 196 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. DPNQJMFS
  183. 197 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. #if compiler(>=4.2) // ίϯύΠϥ 4.2 Ҏ্Ͱ༗ޮͳίʔυ #endif Compiler Version Directive SE-0212 4XJGUίϯύΠϥ Λ൑ఆ Swift 4.2
  184. 198 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. #if compiler(>=4.2) // ίϯύΠϥ 4.2 Ҏ্Ͱ༗ޮͳίʔυ #endif Compiler Version Directive SE-0212 ίϯύΠϥͷόʔδϣϯͰ൑ఆͰ͖Δ 4XJGUίϯύΠϥ Λ൑ఆ Swift 4.2
  185. 199 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Cross-module inlining and specialization SE-0193
  186. 200 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ϞδϡʔϧؒͷΠϯϥΠϯԽΛࢦఆͰ͖ΔΑ͏ʹ ͭͷଐੑ͕௥Ճ • !JOMJOBCMF • !VTBCMF'SPN*OMJOF Cross-module inlining and specialization SE-0193 ֓ཁ ࠓ·Ͱ͸Ϟδϡʔϧ಺ͷΈ
  187. 201 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ΠϯϥΠϯԽͱ͸ʁ
  188. 202 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. func add(_ x: Int, _ y: Int) -> Int { return x + y } add(1, 2) ΠϯϥΠϯԽ Cross-module inlining and specialization SE-0193 Swift 4.2
  189. func add(_ x: Int, _ y: Int) -> Int {

    return x + y } add(1, 2) 203 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ΠϯϥΠϯԽ Cross-module inlining and specialization SE-0193 ؔ਺ݺͼग़͠ͷΦʔόʔϔουֻ͕͔Δ Swift 4.2
  190. func add(_ x: Int, _ y: Int) -> Int {

    return x + y } add(1, 2) 204 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ΠϯϥΠϯԽ 1 + 2 Cross-module inlining and specialization SE-0193 Swift 4.2 Swift 4.2
  191. func add(_ x: Int, _ y: Int) -> Int {

    return x + y } add(1, 2) 205 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ΠϯϥΠϯԽ 1 + 2 Cross-module inlining and specialization SE-0193 Swift 4.2 Swift 4.2 ؔ਺ͷຊମίʔυΛల։
  192. 206 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ϞδϡʔϧؒͷΠϯϥΠϯԽ
  193. 207 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. public class Counter { @usableFromInline var count: Int = 0 public init() {} @inlinable public func add() -> Int { count += 1 return count } } !JOMJOBCMF Cross-module inlining and specialization SE-0193 Swift 4.2
  194. 208 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. public class Counter { @usableFromInline var count: Int = 0 public init() {} @inlinable public func add() -> Int { count += 1 return count } } !JOMJOBCMF Cross-module inlining and specialization SE-0193 ؔ਺ͷΠϯϥΠϯԽΛએݴ Swift 4.2
  195. 209 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. public class Counter { @usableFromInline var count: Int = 0 public init() {} @inlinable public func add() -> Int { count += 1 return count } } !JOMJOBCMF Cross-module inlining and specialization SE-0193 !JOMJOBCMFͳؔ਺͔Βར༻͞ΕΔ৔߹ʹඞཁ Swift 4.2
  196. 210 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. public class Counter { @usableFromInline var count: Int = 0 public init() {} @inlinable public func add() -> Int { count += 1 return count } } !JOMJOBCMF • Ϟδϡʔϧ֎͔Βݺͼग़ͨ࣌͠ʹΠϯϥΠϯԽΛڐՄ • ࣮ࡍʹΠϯϥΠϯԽ͞ΕΔ͔͸ίϯύΠϥґଘ Cross-module inlining and specialization SE-0193 Swift 4.2
  197. 3 211 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.2 Swift Package Manager
  198. 212 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Swift Package Manager 3ͭ SE-0201 SE-0208 SE-0209 Package Manager Local Dependencies Package Manager System Library Targets Package Manager Swift Language Version API Update
  199. 213 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. SE-0201 Package Manager Local Dependencies
  200. 214 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. -PDBMύε΋ґଘؔ܎ͰࢦఆͰ͖ΔΑ͏ʹ QBDLBHF QBUI ֓ཁ Package Manager Local Dependencies SE-0201 ࠓ·Ͱ͸ϦϞʔτ΁ͷUP͕ඞཁͩͬͨ
  201. 215 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. import PackageDescription let package = Package( name: "Package", dependencies: [ .package(path: "/path/to/MyPackage", from: "1.0.0"), ], ... ) -PDBMύεʹ͋ΔґଘΛࢦఆ Package Manager Local Dependencies SE-0201 Swift 4.2
  202. 216 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. import PackageDescription let package = Package( name: "Package", dependencies: [ .package(path: "/path/to/MyPackage", from: "1.0.0"), ], ... ) -PDBMύεʹ͋ΔґଘΛࢦఆ Package Manager Local Dependencies SE-0201 -PDBMύεΛࢦఆՄೳʹ Swift 4.2
  203. 217 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. SE-0209 Package Manager Swift Language Version API Update
  204. 218 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. TXJGU-BOHVBHF7FSTJPOTͷࢦఆ͕&OVNʹ 4XJGU • *OUͰࢦఆ 4XJGU • 4XJGU7FSTJPOͰࢦఆ ֓ཁ Package Manager Swift Language Version API Update SE-0209
  205. 219 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. TXJGU-BOHVBHF7FSTJPOTͷࢦఆ͕&OVNʹ 4XJGU • *OUͰࢦఆ 4XJGU • 4XJGU7FSTJPOͰࢦఆ ֓ཁ Package Manager Swift Language Version API Update SE-0209 Enum
  206. 220 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let package = Package( ... swiftLanguageVersions: [4] ) TXJGU-BOHVBHF7FSTJPOT Swift 4.1 Package Manager Swift Language Version API Update SE-0209
  207. 221 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let package = Package( ... swiftLanguageVersions: [4] ) Swift 4.1 TXJGU-BOHVBHF7FSTJPOT Package Manager Swift Language Version API Update SE-0209 *OUͷ഑ྻͰࢦఆ͍ͯͨ͠
  208. 222 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let package = Package( ... swiftLanguageVersions: [.v4_2, .version("5.0")] ) let package = Package( ... swiftLanguageVersions: [4] ) Swift 4.1 TXJGU-BOHVBHF7FSTJPOT Package Manager Swift Language Version API Update SE-0209 Swift 4.2
  209. 223 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. let package = Package( ... swiftLanguageVersions: [.v4_2, .version("5.0")] ) let package = Package( ... swiftLanguageVersions: [4] ) Swift 4.1 TXJGU-BOHVBHF7FSTJPOT Package Manager Swift Language Version API Update SE-0209 FOVNͷ഑ྻͰࢦఆ͢ΔΑ͏ʹ Swift 4.2
  210. 224 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. SE-0208 Package Manager System Library Targets
  211. 225 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. γεςϜϥΠϒϥϦͷґଘࢦఆ͕มߋ 4XJGU • 1BDLBHFͱͯ͠෼ׂ͕ඞཁ 4XJGU • 5BSHFUͱͯ͠ࢦఆ ֓ཁ Package Manager System Library Targets SE-0208
  212. 226 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. γεςϜϥΠϒϥϦͷґଘࢦఆ͕มߋ 4XJGU • 1BDLBHFͱͯ͠෼ׂ͕ඞཁ 4XJGU • 5BSHFUͱͯ͠ࢦఆ ֓ཁ Package Manager System Library Targets SE-0208
  213. 227 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. γεςϜϥΠϒϥϦͷࢦఆ libxml2 Clibxml Main Swift 4.1 Package Manager System Library Targets SE-0208
  214. 228 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. γεςϜϥΠϒϥϦͷࢦఆ libxml2 Clibxml Main Swift 4.1 Package Manager System Library Targets SE-0208 ؒʹύοέʔδ͕ඞཁ
  215. 229 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. γεςϜϥΠϒϥϦͷࢦఆ libxml2 Clibxml Main libxml2 Main Swift 4.1 Swift 4.2 Package Manager System Library Targets SE-0208
  216. 230 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. γεςϜϥΠϒϥϦͷࢦఆ libxml2 Clibxml Main libxml2 Main Swift 4.1 Swift 4.2 Package Manager System Library Targets SE-0208 5BSHFUͰ௚઀ࢦఆ
  217. 231 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. import PackageDescription let package = Package( ... targets: [ .systemLibrary( name: "CLibxml", pkgConfig: "libxml2" ) ] ) γεςϜϥΠϒϥϦͷࢦఆ Package Manager System Library Targets SE-0208 Swift 4.2
  218. 232 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. import PackageDescription let package = Package( ... targets: [ .systemLibrary( name: "CLibxml", pkgConfig: "libxml2" ) ] ) γεςϜϥΠϒϥϦͷࢦఆ Package Manager System Library Targets SE-0208 5BSHFUͰ௚઀ࢦఆ Swift 4.2
  219. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 234 Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. 4XJGUͷൃදʙ·Ͱͷྺ࢙ 4XJGUͷมߋ఺ "1*ͷ௥Ճมߋ ݴޠ࢓༷ 4XJGU1BDLBHF.BOBHFS ࠓ೔ɺ࿩ͨ͜͠ͱ 1 2 3
  220. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 235 Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. 4XJGUͷൃදʙ·Ͱͷྺ࢙ 4XJGUͷมߋ఺ "1*ͷ௥Ճมߋ ݴޠ࢓༷ 4XJGU1BDLBHF.BOBHFS 18 proposals 1 2 3 ࠓ೔ɺ࿩ͨ͜͠ͱ
  221. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 236 Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. 4XJGUͷൃදʙ·Ͱͷྺ࢙ 4XJGUͷมߋ఺ "1*ͷ௥Ճมߋ ݴޠ࢓༷ 4XJGU1BDLBHF.BOBHFS 1 2 3 ࠓ೔ɺ࿩ͨ͜͠ͱ
  222. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 237 Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. 4XJGUͷൃදʙ·Ͱͷྺ࢙ 4XJGUͷมߋ఺ "1*ͷ௥Ճมߋ ݴޠ࢓༷ 4XJGU1BDLBHF.BOBHFS 1 2 3 ࠓ೔ɺ࿩ͨ͜͠ͱ
  223. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 238 Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. 4XJGUͷൃදʙ·Ͱͷྺ࢙ 4XJGUͷมߋ఺ "1*ͷ௥Ճมߋ ݴޠ࢓༷ 4XJGU1BDLBHF.BOBHFS 1 2 3 ࠓ೔ɺ࿩ͨ͜͠ͱ
  224. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 239 Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. 4XJGUͷൃදʙ·Ͱͷྺ࢙ 4XJGUͷมߋ఺ "1*ͷ௥Ճมߋ ݴޠ࢓༷ 4XJGU1BDLBHF.BOBHFS ਐԽͯͨ͠ʁ 1 2 3 ࠓ೔ɺ࿩ͨ͜͠ͱ
  225. Swift is evolving 240 Copyright (C) DeNA Co.,Ltd. All Rights

    Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved.