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
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 ͷՃ / มߋ ̓ͭ
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
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͕ඞཁ
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*
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
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
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
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
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
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
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 ۮͰͳ͍ཁૉ͕
% 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 ؚ·Ε͍ͯͳ͍͜ͱ
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ʣ
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
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 ۮͰͳ͍ཁૉΛ
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 औΓग़ͯ͠࠶ೖ
DeNA Co.,Ltd. All Rights Reserved. MFUͳʹରͯ͠ݺͼग़ͤΔΑ͏ʹ XJUI6OTBGF1PJOUFS UP@ XJUI6OTBGF#ZUFT PG@ ֓ཁ withUnsafePointer(to:_:) and withUnsafeBytes(of:_:) for immutable values SE-0205
DeNA Co.,Ltd. All Rights Reserved. ࢦఆͨ͠ΩʔύεͷϝϞϦΦϑηοτΛऔಘ͢Δ"1* .FNPSZ-BZPVU • P⒎TFU PG ֓ཁ Add an offset(of:) method to MemoryLayout SE-0210 OpenGL ͳͲͰศརʢΒ͍͠ʣ
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
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
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
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ʹ͢
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
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
^ 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Λద߹ ࣗલͰϋογϡΛܭࢉ͢Δඞཁ͕͋ͬͨ
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
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
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
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
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
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
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
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
DeNA Co.,Ltd. All Rights Reserved. ίϯύΠϧஈ֊Ͱ֬ఆͯ͠ͳ͍ϓϩύςΟʹ υοτه๏ͰΞΫηεͰ͖ΔΈ ֓ཁ Introduce User-defined "Dynamic Member Lookup" Types SE-0195 %ZOBNJD.FNCFS-PPLVQ • $ISJT-BUUOFS͕ఏҊɾ࣮ • +40/֎෦ݴޠͷݺͼग़͠ʢ''*ʣͳͲʹ
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
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 ϝιουͳͲΛͯ͢จࣈྻͰࢦఆ
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
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ίʔυͱ΄΅ಉ͡ʹ
DeNA Co.,Ltd. All Rights Reserved. *60ܕɹ➔ɹ*60ଐੑ *NQMJDJUMZ6OXSBQQFE0QUJPOBMܕ • ҉తΞϯϥοϓܕʢFY4USJOHʣ • 4XJGUY͔Β։࢝͞Εͨ • 0QUJPOBMܕʹ౷Ұ ֓ཁ Abolish ImplicitlyUnwrappedOptional type SE-0054 4.2 Ͱશഇࢭʂ
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
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
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
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
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
DeNA Co.,Ltd. All Rights Reserved. @implicitlyUnwrappedOptional let xs: Int? = 42 *60ଐੑͱʁ Abolish ImplicitlyUnwrappedOptional type SE-0054 ͜͏͍͏ଐੑ͕༩͞Εͯ Swift 4.2
DeNA Co.,Ltd. All Rights Reserved. @implicitlyUnwrappedOptional let xs: Int? = 42 *60ଐੑͱʁ Abolish ImplicitlyUnwrappedOptional type SE-0054 ܕ0QUJPOBM*OU Swift 4.2
DeNA Co.,Ltd. All Rights Reserved. @implicitlyUnwrappedOptional let xs: Int? = 42 *60ଐੑͱʁ Abolish ImplicitlyUnwrappedOptional type SE-0054 ίϯύΠϥ෦ଐੑͳͷͰఆٛෆՄ Swift 4.2
DeNA Co.,Ltd. All Rights Reserved. extension Array: Equatable where Element: Equatable { } $POEJUJPOBM$POGPSNBODFT Conditional conformances SE-0143 Swift 4.2
DeNA Co.,Ltd. All Rights Reserved. extension Array: Equatable where Element: Equatable { } $POEJUJPOBM$POGPSNBODFT Conditional conformances SE-0143 ཁૉͷܕ͕&RVBUBCMFͳ߹ʹ Swift 4.2
DeNA Co.,Ltd. All Rights Reserved. extension Array: Equatable where Element: Equatable { } $POEJUJPOBM$POGPSNBODFT Conditional conformances SE-0143 "SSBZΛ&RVBUBCMFʹ४ڌ Swift 4.2
DeNA Co.,Ltd. All Rights Reserved. extension Array: Equatable where Element: Equatable { } $POEJUJPOBM$POGPSNBODFT Conditional conformances SE-0143 4XJGU͔ΒͰ͖ΔΑ͏ʹͳͬͨ Swift 4.2
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
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Ͱએݴ
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ʹ४ڌ͍ͯ͠Δ͔ʁ
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 Ͱਖ਼͘͠ఆͰ͖ͳ͔ͬͨ
= 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
DeNA Co.,Ltd. All Rights Reserved. struct User: Hashable { var name: String var pets: [String] } ྫɿߏମͷ)BTIBCMFద߹ Conditional conformances SE-0143 Swift 4.1
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
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
DeNA Co.,Ltd. All Rights Reserved. #warning("औಘͨ͠APIΩʔΛઃఆ͍ͯͩ͘͠͞ɻ") let apiKey = "" #error("ίʔϧόοΫURLΛઃఆ͢Δඞཁ͕͋Γ·͢ɻ") let callbackURL = "" ίϯύΠϥɾσΟϨΫςΟϒ Compiler Diagnostic Directives SE-0196 Swift 4.2
DeNA Co.,Ltd. All Rights Reserved. #warning("औಘͨ͠APIΩʔΛઃఆ͍ͯͩ͘͠͞ɻ") let apiKey = "" #error("ίʔϧόοΫURLΛઃఆ͢Δඞཁ͕͋Γ·͢ɻ") let callbackURL = "" ίϯύΠϥɾσΟϨΫςΟϒ Compiler Diagnostic Directives SE-0196 XBSOJOHͰܯࠂ Swift 4.2
DeNA Co.,Ltd. All Rights Reserved. #warning("औಘͨ͠APIΩʔΛઃఆ͍ͯͩ͘͠͞ɻ") let apiKey = "" #error("ίʔϧόοΫURLΛઃఆ͢Δඞཁ͕͋Γ·͢ɻ") let callbackURL = "" ίϯύΠϥɾσΟϨΫςΟϒ Compiler Diagnostic Directives SE-0196 FSSPSͰίϯύΠϧΤϥʔ Swift 4.2
DeNA Co.,Ltd. All Rights Reserved. ίϯύΠϥɾσΟϨΫςΟϒ Compiler Diagnostic Directives SE-0196 #warning("औಘͨ͠APIΩʔΛઃఆ͍ͯͩ͘͠͞ɻ") let apiKey = "" #error("ίʔϧόοΫURLΛઃఆ͢Δඞཁ͕͋Γ·͢ɻ") let callbackURL = "" ར༻ྫɿαϯϓϧίʔυʹهड़ Swift 4.2
DeNA Co.,Ltd. All Rights Reserved. #if compiler(>=4.2) // ίϯύΠϥ 4.2 Ҏ্Ͱ༗ޮͳίʔυ #endif Compiler Version Directive SE-0212 ίϯύΠϥͷόʔδϣϯͰఆͰ͖Δ 4XJGUίϯύΠϥ Λఆ Swift 4.2
DeNA Co.,Ltd. All Rights Reserved. ϞδϡʔϧؒͷΠϯϥΠϯԽΛࢦఆͰ͖ΔΑ͏ʹ ͭͷଐੑ͕Ճ • !JOMJOBCMF • !VTBCMF'SPN*OMJOF Cross-module inlining and specialization SE-0193 ֓ཁ ࠓ·ͰϞδϡʔϧͷΈ
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
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
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
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 ؔͷຊମίʔυΛల։
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
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
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
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
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
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
DeNA Co.,Ltd. All Rights Reserved. TXJGU-BOHVBHF7FSTJPOTͷࢦఆ͕&OVNʹ 4XJGU • *OUͰࢦఆ 4XJGU • 4XJGU7FSTJPOͰࢦఆ ֓ཁ Package Manager Swift Language Version API Update SE-0209
DeNA Co.,Ltd. All Rights Reserved. TXJGU-BOHVBHF7FSTJPOTͷࢦఆ͕&OVNʹ 4XJGU • *OUͰࢦఆ 4XJGU • 4XJGU7FSTJPOͰࢦఆ ֓ཁ Package Manager Swift Language Version API Update SE-0209 Enum
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
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ͷྻͰࢦఆ͍ͯͨ͠
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
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
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Ͱࢦఆ