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

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

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

70d9714ea13fc1133803d61fb16e4160?s=128

Yusuke Hosonuma

August 31, 2018
Tweet

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. About 2 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved.
  3. 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
  4. ࠷ۙɺ࡞ͬͨαʔϏε 4 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

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

    DeNA Co.,Ltd. All Rights Reserved. CfPΛշదʹݕࡧ ؔ࿈Πϕϯτ΋ʂ
  6. Today 6 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

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

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

    Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ͦΕ͚ͩ͡Ό෺଍Γͳ͍ʁ
  9. ൃද౰࣌ ͔ΒৼΓฦͬͯΈΔ 9 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  10. ͓͜ͱΘΓ 10 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved.
  11. ͓͜ͱΘΓ Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 11 Copyright

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

    (C) DeNA Co.,Ltd. All Rights Reserved.
  13. 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ݸ͕࣮૷
  14. 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 ൃද ·Ͱͷྺ࢙
  15. Swift History 15 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  16. WWDC 2014 16 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. 17 Copyright (C)

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

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

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

    20 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Swift ൃද ࠷ॳ͔Β iOS։ൃऀ΋େ஫໨
  21. 4.1·ͰΛৼΓฦΔ 21 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. ͞Βͬͱ
  22. 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
  23. Swift 1.0 23 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

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

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

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

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

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

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

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  30. 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
  31. Swift 3.0 31 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

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

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

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

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

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

    36 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.1 ܕγεςϜͳͲͷਐԽ ଴๬ͷػೳ
  37. ৼΓฦͬͯΈΔͱ 37 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved.
  38. ͋ΒͨΊͯࢥ͏ 38 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved.
  39. Swift ͬͯ 39 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

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

    Rights Reserved. 40 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ͳΜ͔ͩπϥΠ…
  41. ண࣮ʹਐԽ͍ͯ͠Δʁ 41 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. Ͱ΋
  42. ͢΂ͯ͸ཧ૝ͷ ϓϩάϥϛϯάݴޠͷͨΊʁ 42 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

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

    Rights Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  44. 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 ൃද ·Ͱͷྺ࢙
  45. Swift 4.2 ͷ֓ཁ 45 Copyright (C) DeNA Co.,Ltd. All Rights

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

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

    (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.2 API ͷ௥Ճ / มߋ
  48. 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 ͷ௥Ճ / มߋ ̓ͭ
  49. Random Unification 49 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

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

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

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  52. 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
  53. 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͕ඞཁ
  54. 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*
  55. 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
  56. 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
  57. ഑ྻ͔ΒϥϯμϜʹऔಘ 57 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved.
  58. 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
  59. 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
  60. 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
  61. ഑ྻΛγϟοϑϧ 61 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved.
  62. 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
  63. 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
  64. 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
  65. 65 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Adding toggle to Bool SE-0199
  66. 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
  67. 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
  68. 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 ൱ఆԋࢉࢠͰ൓సͯ͠୅ೖ
  69. 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
  70. 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
  71. ͪͳΈʹ࣮૷͸ʁ 71 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved.
  72. 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
  73. 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 ΠϯϥΠϯԽ͞ΕΔͷͰύϑΥʔϚϯε௿Լ΋৺഑ͳ͍
  74. 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
  75. 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 Ұ؏ੑΛ࣋ͨͤΔͨΊมߋ
  76. 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
  77. 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 ͱʹ͔͘໘౗…
  78. 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
  79. 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
  80. 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
  81. 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
  82. 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
  83. 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 ۮ਺Ͱͳ͍ཁૉ͕
  84. 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 ؚ·Ε͍ͯͳ͍͜ͱ
  85. 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
  86. 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
  87. 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
  88. 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ʣ
  89. 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
  90. 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 ۮ਺Ͱͳ͍ཁૉΛ
  91. 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 औΓग़ͯ͠࠶୅ೖ
  92. 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
  93. 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
  94. 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
  95. 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
  96. 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
  97. 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ʹ୅ೖ͠௚ͯ͠
  98. 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 ࢀরΛ౉͢
  99. 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
  100. 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
  101. 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
  102. 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 ͳͲͰศརʢΒ͍͠ʣ
  103. 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
  104. 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
  105. 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
  106. 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ʹ౉͢
  107. 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
  108. 2 108 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.2 ݴޠ࢓༷
  109. 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ͭ
  110. 110 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. SE-0206 Hashable Enhancements
  111. 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
  112. 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
  113. 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
  114. 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
  115. 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
  116. 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Λద߹ ࣗલͰϋογϡ஋Λܭࢉ͢Δඞཁ͕͋ͬͨ
  117. 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
  118. 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 ϋογϡ஋Λܭࢉ͢ΔΦϒδΣΫτ
  119. 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
  120. 120 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Derived Collection of Enum Cases SE-0194
  121. 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
  122. Swift 4.1 ͷ৔߹ 122 Copyright (C) DeNA Co.,Ltd. All Rights

    Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  123. 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
  124. 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
  125. 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
  126. Swift 4.2 ͷ৔߹ 126 Copyright (C) DeNA Co.,Ltd. All Rights

    Reserved. Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  127. 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
  128. 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
  129. 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
  130. 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
  131. allCases ͷΧελϚΠζ 131 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  132. 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
  133. 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
  134. 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
  135. 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/΍֎෦ݴޠͷݺͼग़͠ʢ''*ʣͳͲʹ
  136. ྫɿplist ʹΞΫηε͢Δ 136 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  137. 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
  138. 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
  139. 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
  140. 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
  141. 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
  142. ྫɿPython ࿈ܞ 142 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

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

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  144. 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
  145. 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 ϝιουͳͲΛ͢΂ͯจࣈྻͰࢦఆ
  146. Swift 4.2 146 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  147. 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
  148. 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ίʔυͱ΄΅ಉ͡ʹ
  149. 149 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Abolish ImplicitlyUnwrappedOptional type SE-0054
  150. 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 Ͱ׬શഇࢭʂ
  151. 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 Β͍͠
  152. [Int!] ͷܕ͸Կ͔ʁ 152 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Λௐ΂ͯΈΔ
  153. 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
  154. 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
  155. 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
  156. 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
  157. 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
  158. IUO ଐੑͱ͸ʁ 158 Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
  159. 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
  160. 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
  161. 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
  162. 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
  163. 163 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

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

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

    DeNA Co.,Ltd. All Rights Reserved. $POEJUJPOBMDPOGPSNBODFTʁ
  166. 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
  167. 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
  168. 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
  169. 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
  170. 170 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ࣮ߦ࣌ͷϓϩτίϧద߹൑ఆ 4.2 Ͱͷվળ ᶃ
  171. 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
  172. 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 ʮҿΊΔʯΛදݱ͢Δϓϩτίϧ
  173. 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 ΧϨʔ͸΋ͪΖΜʮҿΈ෺ʯ
  174. 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 ΧϨʔࡼ͕ʮҿΈ෺ʯͰ͋Ε͹ɺԿࡼͰ΋ʮҿΈ෺ʯ
  175. 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
  176. 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Ͱએݴ
  177. 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ʹ४ڌ͍ͯ͠Δ͔ʁ
  178. 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 Ͱ͸ਖ਼͘͠൑ఆͰ͖ͳ͔ͬͨ
  179. 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
  180. 180 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ഑ྻͳͲ͕)BTIBCMFʹద߹ 4.2 Ͱͷվળ ᶄ
  181. 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
  182. 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
  183. 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
  184. 184 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Compiler Diagnostic Directives SE-0196
  185. 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 ʹ͸͋ͬͨ
  186. 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
  187. 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
  188. 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
  189. 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
  190. 190 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

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

    DeNA Co.,Ltd. All Rights Reserved. Compiler Version Directive SE-0212
  192. 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 όʔδϣϯ Ͱ͔͠ग़དྷͳ͔ͬͨ
  193. 193 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. TXJGU Ͱ SwiftίϯύΠϥ 4.1+ Λ൑ఆ
  194. 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
  195. 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
  196. 196 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. DPNQJMFS
  197. 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
  198. 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
  199. 199 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. Cross-module inlining and specialization SE-0193
  200. 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 ֓ཁ ࠓ·Ͱ͸Ϟδϡʔϧ಺ͷΈ
  201. 201 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ΠϯϥΠϯԽͱ͸ʁ
  202. 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
  203. 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
  204. 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
  205. 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 ؔ਺ͷຊମίʔυΛల։
  206. 206 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. ϞδϡʔϧؒͷΠϯϥΠϯԽ
  207. 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
  208. 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
  209. 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
  210. 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
  211. 3 211 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved. Swift 4.2 Swift Package Manager
  212. 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
  213. 213 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. SE-0201 Package Manager Local Dependencies
  214. 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͕ඞཁͩͬͨ
  215. 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
  216. 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
  217. 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
  218. 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
  219. 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
  220. 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
  221. 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ͷ഑ྻͰࢦఆ͍ͯͨ͠
  222. 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
  223. 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
  224. 224 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright (C)

    DeNA Co.,Ltd. All Rights Reserved. SE-0208 Package Manager System Library Targets
  225. 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
  226. 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
  227. 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
  228. 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 ؒʹύοέʔδ͕ඞཁ
  229. 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
  230. 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Ͱ௚઀ࢦఆ
  231. 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
  232. 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
  233. Conclusion 233 Copyright (C) DeNA Co.,Ltd. All Rights Reserved. Copyright

    (C) DeNA Co.,Ltd. All Rights Reserved.
  234. 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
  235. 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 ࠓ೔ɺ࿩ͨ͜͠ͱ
  236. 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 ࠓ೔ɺ࿩ͨ͜͠ͱ
  237. 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 ࠓ೔ɺ࿩ͨ͜͠ͱ
  238. 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 ࠓ೔ɺ࿩ͨ͜͠ͱ
  239. 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 ࠓ೔ɺ࿩ͨ͜͠ͱ
  240. Swift is evolving 240 Copyright (C) DeNA Co.,Ltd. All Rights

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