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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  4. ࠷ۙɺ࡞ͬͨαʔϏε
    4
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    ஥ؒͱҰॹʹ

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  8. Swift 4.2 ͷมߋ఺
    8
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    ͦΕ͚ͩ͡Ό෺଍Γͳ͍ʁ

    View full-size slide

  9. ൃද౰࣌ ͔ΒৼΓฦͬͯΈΔ
    9
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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ݸ͕࣮૷

    View full-size slide

  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
    ൃද
    ·Ͱͷྺ࢙

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  18. ·͔͞ͷ৽ݴޠ͕ൃදʂ
    18
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    ୭΋༧૝ͯ͠ͳ͔ͬͨʂ

    View full-size slide

  19. Swift ൃද
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    19
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    ߴ଎
    Ϟμϯ
    ҆શ
    ΠϯλϥΫςΟϒ

    View full-size slide

  20. υΩϡϝϯτ
    88%$ձ৔͸େ͖ͳഥख
    Swift
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    20
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Swift ൃද
    ࠷ॳ͔Β
    iOS։ൃऀ΋େ஫໨

    View full-size slide

  21. 4.1·ͰΛৼΓฦΔ
    21
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    ͞Βͬͱ

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  26. 'BJMBCMF*OJUJBMJ[FS
    ΍͸ΓϏϧυ͕࣌ؒ௕͍
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    26
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Swift 1.1 ҆ఆੑͷ޲্
    ͓ۚͰղܾʁ

    View full-size slide

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

    View full-size slide

  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 େ෯ͳػೳ௥Ճ
    ࠩ෼Ϗϧυʂ

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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 ഁյతͳ࢓༷มߋʢͲͬ͞Γʣ
    ໋໊نଇͷશ໘ݟ௚͠

    View full-size slide

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

    View full-size slide

  34. $PEBCMF
    ώΞυΩϡϝϯτ
    จࣈྻͷίϨΫγϣϯԽ͕෮׆
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    34
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Swift 4.0 ศརͳػೳ͕ଓʑͱ
    ษڧձͰେਓؾʂ

    View full-size slide

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

    View full-size slide

  36. $POEJUJPOBMDPOGPSNBODFT
    ࠶ؼతͳϓϩτίϧ੍໿
    &RVBUBCMF)BTIBCMFͷ҉໧࣮૷
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    36
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Swift 4.1 ܕγεςϜͳͲͷਐԽ
    ଴๬ͷػೳ

    View full-size slide

  37. ৼΓฦͬͯΈΔͱ
    37
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  41. ண࣮ʹਐԽ͍ͯ͠Δʁ
    41
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Ͱ΋

    View full-size slide

  42. ͢΂ͯ͸ཧ૝ͷ
    ϓϩάϥϛϯάݴޠͷͨΊʁ
    42
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    ௧Έແ͠ͰਐԽͳͲग़དྷͳ͍ʂ

    View full-size slide

  43. What’s Swift 4.2 ?
    43
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

  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
    ൃද
    ·Ͱͷྺ࢙

    View full-size slide

  45. Swift 4.2 ͷ֓ཁ
    45
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

  46. 9DPEF
    ഁյతͳ࢓༷มߋ͸Θ͔ͣ
    ݴޠͱͯ͠ॱ౰ͳόʔδϣϯΞοϓ
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    46
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Swift 4.2 ͷ֓ཁ
    ࠓ͸ beta 6
    ͱ͍͏ҹ৅

    View full-size slide

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

    View full-size slide

  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 ͷ௥Ճ / มߋ
    ̓ͭ

    View full-size slide

  49. Random Unification
    49
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    SE-0202

    View full-size slide

  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

    View full-size slide

  51. 1. ൣғ͔Βੜ੒
    51
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

  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

    View full-size slide

  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͕ඞཁ

    View full-size slide

  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*

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  57. ഑ྻ͔ΒϥϯμϜʹऔಘ
    57
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  61. ഑ྻΛγϟοϑϧ
    61
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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
    ൱ఆԋࢉࢠͰ൓సͯ͠୅ೖ

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  71. ͪͳΈʹ࣮૷͸ʁ
    71
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

  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

    View full-size slide

  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
    ΠϯϥΠϯԽ͞ΕΔͷͰύϑΥʔϚϯε௿Լ΋৺഑ͳ͍

    View full-size slide

  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

    View full-size slide

  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
    Ұ؏ੑΛ࣋ͨͤΔͨΊมߋ

    View full-size slide

  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

    View full-size slide

  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
    ͱʹ͔͘໘౗…

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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
    ۮ਺Ͱͳ͍ཁૉ͕

    View full-size slide

  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
    ؚ·Ε͍ͯͳ͍͜ͱ

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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ʣ

    View full-size slide

  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

    View full-size slide

  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
    ۮ਺Ͱͳ͍ཁૉΛ

    View full-size slide

  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
    औΓग़ͯ͠࠶୅ೖ

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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ʹ୅ೖ͠௚ͯ͠

    View full-size slide

  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
    ࢀরΛ౉͢

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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 ͳͲͰศརʢΒ͍͠ʣ

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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ʹ౉͢

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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
    ݴޠ࢓༷

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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Λద߹
    ࣗલͰϋογϡ஋Λܭࢉ͢Δඞཁ͕͋ͬͨ

    View full-size slide

  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

    View full-size slide

  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
    ϋογϡ஋Λܭࢉ͢ΔΦϒδΣΫτ

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  122. Swift 4.1 ͷ৔߹
    122
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  126. Swift 4.2 ͷ৔߹
    126
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  131. allCases ͷΧελϚΠζ
    131
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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/΍֎෦ݴޠͷݺͼग़͠ʢ''*ʣͳͲʹ

    View full-size slide

  136. ྫɿplist ʹΞΫηε͢Δ
    136
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  142. ྫɿPython ࿈ܞ
    142
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Proposal ΑΓൈਮ

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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
    ϝιουͳͲΛ͢΂ͯจࣈྻͰࢦఆ

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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ίʔυͱ΄΅ಉ͡ʹ

    View full-size slide

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

    View full-size slide

  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 Ͱ׬શഇࢭʂ

    View full-size slide

  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
    Β͍͠

    View full-size slide

  152. [Int!] ͷܕ͸Կ͔ʁ
    152
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Λௐ΂ͯΈΔ

    View full-size slide

  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>.Type
    <*OU>ͷܕ͸Կ͔ʁ
    Abolish ImplicitlyUnwrappedOptional type SE-0054
    Swift 4.1

    View full-size slide

  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>.Type
    <*OU>ͷܕ͸Կ͔ʁ
    Abolish ImplicitlyUnwrappedOptional type SE-0054
    Swift 4.1
    *NQMJDJUMZ6OXSBQQFE0QUJPOBM*OU

    View full-size slide

  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>.Type
    type(of: xs) // Array>.Type
    <*OU>ͷܕ͸Կ͔ʁ
    Abolish ImplicitlyUnwrappedOptional type SE-0054
    Swift 4.1
    Swift 4.2

    View full-size slide

  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>.Type
    type(of: xs) // Array>.Type
    <*OU>ͷܕ͸Կ͔ʁ
    Abolish ImplicitlyUnwrappedOptional type SE-0054
    Swift 4.1
    0QUJPOBM*OU
    Swift 4.2

    View full-size slide

  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>.Type
    type(of: xs) // Array>.Type
    <*OU>ͷܕ͸Կ͔ʁ
    Abolish ImplicitlyUnwrappedOptional type SE-0054
    Swift 4.1
    Swift 4.2
    • ɹ*NQMJDJUMZ6OXSBQQFE0QUJPOBM*OU
    • ɹ0QUJPOBM*OU

    View full-size slide

  158. IUO ଐੑͱ͸ʁ
    158
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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
    ʮҿΊΔʯΛදݱ͢Δϓϩτίϧ

    View full-size slide

  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
    ΧϨʔ͸΋ͪΖΜʮҿΈ෺ʯ

    View full-size slide

  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
    ΧϨʔࡼ͕ʮҿΈ෺ʯͰ͋Ε͹ɺԿࡼͰ΋ʮҿΈ෺ʯ

    View full-size slide

  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

    View full-size slide

  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Ͱએݴ

    View full-size slide

  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ʹ४ڌ͍ͯ͠Δ͔ʁ

    View full-size slide

  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
    Ͱ͸ਖ਼͘͠൑ఆͰ͖ͳ͔ͬͨ

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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 ʹ͸͋ͬͨ

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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ͱಉ༷

    View full-size slide

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

    View full-size slide

  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 όʔδϣϯ Ͱ͔͠ग़དྷͳ͔ͬͨ

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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
    ֓ཁ
    ࠓ·Ͱ͸Ϟδϡʔϧ಺ͷΈ

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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
    ؔ਺ͷຊମίʔυΛల։

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

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

    SE-0201
    SE-0208
    SE-0209
    Package Manager Local Dependencies
    Package Manager System Library Targets
    Package Manager Swift Language Version API Update

    View full-size slide

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

    View full-size slide

  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͕ඞཁͩͬͨ

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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ͷ഑ྻͰࢦఆ͍ͯͨ͠

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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
    ؒʹύοέʔδ͕ඞཁ

    View full-size slide

  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

    View full-size slide

  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Ͱ௚઀ࢦఆ

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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
    ࠓ೔ɺ࿩ͨ͜͠ͱ

    View full-size slide

  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
    ࠓ೔ɺ࿩ͨ͜͠ͱ

    View full-size slide

  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
    ࠓ೔ɺ࿩ͨ͜͠ͱ

    View full-size slide

  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
    ࠓ೔ɺ࿩ͨ͜͠ͱ

    View full-size slide

  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
    ࠓ೔ɺ࿩ͨ͜͠ͱ

    View full-size slide

  240. Swift is evolving
    240
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.
    Copyright (C) DeNA Co.,Ltd. All Rights Reserved.

    View full-size slide