SlideShare a Scribd company logo
1 of 43
Download to read offline
What's new in
Swift3
@TachibanaKaoru
2015/12/16
@TachibanaKaoru, 2015 1
自己紹介
渋谷のVOYAGE GROUPでiOSエンジ
ニアをしています。
Twitter: @TachibanaKaoru
Blog : http://www.toyship.org/
@TachibanaKaoru, 2015 2
VOYAGE GROUP
4 appetiというグルメアプリや、朝
時間.jpという朝時間活用アプリな
どをだしてます。
@TachibanaKaoru, 2015 3
try! Swift
4 2016/3/2~3/4 at Shibuya
4 http://tryswiftconf.com/
4 VOYAGE GROUP はtry Swiftのスポンサーです。
@TachibanaKaoru, 2015 4
Swift is Open Source
@TachibanaKaoru, 2015 5
Swift is Open Source
@TachibanaKaoru, 2015 6
@TachibanaKaoru, 2015 7
Swift Evolution
Swiftのソースコードがオープンソースになっただけではな
く、今後のSwiftの新規機能の議論もオープンされ、自由に参
加できるようにもなりました。
@TachibanaKaoru, 2015 8
Swift Evolution
@TachibanaKaoru, 2015 9
@TachibanaKaoru, 2015 10
前回のSwiftのメジャーバ
ージョンアップをふりか
えってみると……
@TachibanaKaoru, 2015 11
WWDC 2015でSwift 2.0
とiOS9が発表
@TachibanaKaoru, 2015 12
早くiOS9の機能を使いた
い!
@TachibanaKaoru, 2015 13
iOS9の新機能を使うため
には、最新のXcodeを使
う必要があり、Swiftが
強制的に1.2 -> 2.0にバー
ジョンアップされる。
@TachibanaKaoru, 2015 14
Swift 1.2とSwift 2.0には
コード互換性がない!
@TachibanaKaoru, 2015 15
Swift 1.2 -> 2.0のマイグ
レーションツールが(一
応)あったけど、まとも
に動かず、結局手動でソ
ースコード修正
@TachibanaKaoru, 2015 16
\(^o^)/
@TachibanaKaoru, 2015 17
次回はそうならないよう
に、Swift Evolutionの内
容から、今後のSwiftの
ロードマップを予習して
いきましょう。
@TachibanaKaoru, 2015 18
Swift 2.2
@TachibanaKaoru, 2015 19
Swift 2.2
まず、2016年春に、Swift 2.2のリリースが予定されています
4 バグ修正、実装の品質向上、(warning messageなど)、
コンパイル時間改善、パフォーマンス改善
4 コード互換性あり。
4 3.0のリリースを見据えて、将来のコード変更に対する
warningを表示するようになる
@TachibanaKaoru, 2015 20
Swift 3.0
@TachibanaKaoru, 2015 21
Swift 3.0
2016年秋に、Swift 3.0のリリースが予定されています。
言語と標準ライブラリのバイナリレベルでのインターフェース
を安定させることが目的。
2系バージョンからのコードレベルの互換性はありません。
@TachibanaKaoru, 2015 22
Swift 3.0
4 Stable ABI(binary interface)
4 Resilience,Portability
4 Type system cleanup and documentation
4 Complete generics
4 Focus and refine the language
4 API design guidelines
@TachibanaKaoru, 2015 23
Swift 3.0で対応しないこと
4 2系Swiftとのソースレベルの互換性
4 並列処理の言語サポート
4 C++との互換性、マクロ
4 標準ライブラリの拡張
@TachibanaKaoru, 2015 24
Proposals
これからSwiftに導入される機能はProposal単位で検討され
ています。
@TachibanaKaoru, 2015 25
Proposals
@TachibanaKaoru, 2015 26
@TachibanaKaoru, 2015 27
Proposalとは。
今後のSwiftに追加したい or 削除したい機能の提案です。
どのProposalを採用するかどうかの議論は、swift-
revolution-mlで行われており、誰でも参加することができま
す。
(もちろんProposalの提案も!)
@TachibanaKaoru, 2015 28
Current Proposals (1/2)
0001-keywords-as-argument-labels
0002-remove-currying
0003-remove-var-parameters-patterns
0004-remove-pre-post-inc-decrement
0005-objective-c-name-translation
0006-apply-api-guidelines-to-the-standard-lib
0007-remove-c-style-for-loops
@TachibanaKaoru, 2015 29
Current Proposals (2/2)
0008-lazy-flatmap-for-optionals
0009-require-self-for-accessing-instance-members
0010-add-staticstring-unicodescalarview
0011-replace-typealias-associated
0012-add-noescape-to-public-library-api
0013-remove-partial-application-super
0014-constrained-AnySequence
@TachibanaKaoru, 2015 30
What is 'proposals
現在14件中、Swift2.2での採用が1件、Swift3.0での採用が5
件。
それ以外は検討中です。
@TachibanaKaoru, 2015 31
[0001] Allow keywords as argument labels
4 Status: Swift2.2で採用
4 Author: Doug Gregor
inやrepeatやdeferなどのキーワードとして使われていた単
語を変数のラベル名に利用することができるようになる。
(inout,var,let以外のすべての単語が使えるようになる)
@TachibanaKaoru, 2015 32
let numArray = [1,2,3]
// OK on Swift 2.1/2.2
func indexOf1(a: Int, within: [Int]){ }
indexOf1(2, within: numArray)
// OK on Swift 2.1/2.2
func indexOf3(a: Int, `in`: [Int]){ }
indexOf3(2, `in`: numArray)
// Error on Swift 2.1,OK on Swift 2.2
func indexOf2(a: Int, in: [Int]){ }
@TachibanaKaoru, 2015 33
[0002] Removing currying func declaration
syntax
Status: Swift3.0で採用
Author(s): Joe Groff
カリー化の簡易記法がなくなる。
(カリー化ができなくなるということではありません。)
@TachibanaKaoru, 2015 34
カリー化とは
func addTwoInts(a a: Int, b: Int) -> Int {
return a + b
}
addTwoInts(a: 2, b: 3)
func addTwoIntsCurried(a a: Int) -> ( Int -> Int) {
func addTheOtherInt(b: Int) -> Int {
return a + b
}
return addTheOtherInt
}
let a1 = addTwoIntsCurried(a: 2)
a1(3)
@TachibanaKaoru, 2015 35
// OK in Swift2:
func curried(x: Int)(y: String) -> Float {
return Float(x) + Float(y)!
}
// OK in Swift2 and Swift3:
func curried(x: Int) -> (String) -> Float {
return {(y: String) -> Float in
return Float(x) + Float(y)!
}
}
@TachibanaKaoru, 2015 36
[0003] Removing var from Function
Parameters and Pattern Matching
Status: Swift3.0で採用
Author(s): David Farler
if varなどが使えなくなる。
let num : Int? = getOptionalInt()
if var num = num {// if let だとerror
num = 12
}
@TachibanaKaoru, 2015 37
[0004] Remove the ++ and -- operators
Status: Swift3.0で採用
Author: Chris Lattner
++と--をなくしましょう!
(Proposal7とも関連)
@TachibanaKaoru, 2015 38
Finally, these fail the
metric of "if we didn't
already have these, would
we add them to Swift 3?"
@TachibanaKaoru, 2015 39
[0005] Better Translation of Objective-C
APIs Into Swift
Status: Swift3.0で採用
Author(s): Doug Gregor, Dave Abrahams
Objective-CのAPIをSwiftにインポートする時のトランスレ
ーション処理の改善。
Stripping the "NS" Prefix なども含まれている。
@TachibanaKaoru, 2015 40
[0006] Apply API Guidelines to the
Standard Library
Status: レビュー待ち
Author(s): Dave Abrahams, Dmitri Gribenko, Maxim
Moiseev
Swift3.0の一部としてSwift API Design Guidelinesが公開
されるので、標準ライブラリをそれに沿った実装にする。
@TachibanaKaoru, 2015 41
[0007] Remove C-style for-loops with
conditions and incrementers
Status: Swift3.0で採用
Author(s): Erica Sadun
for-loopやめてfor-inを使いましょう。
var array = [10,20,30,40,50]
for(var i=0 ; i < array.count ;i++){
println("array[i] (array[i])")
}
@TachibanaKaoru, 2015 42
4 これ以降のProposalはレビュー待ち...
4 そして、これ以外のproposalも続々出されています。
4 swift-revolution-mlを読んで次世代Swiftの準備をしよ
う!
@TachibanaKaoru, 2015 43

More Related Content

What's hot

アジャイルジャパン長野サテライト
アジャイルジャパン長野サテライトアジャイルジャパン長野サテライト
アジャイルジャパン長野サテライトMasahiro Tomita
 
20160529 30 android-workshop_upload
20160529 30 android-workshop_upload20160529 30 android-workshop_upload
20160529 30 android-workshop_uploadatelire-akihabara
 
20160529 Pepper SDK for Android Studio
20160529 Pepper SDK for Android Studio 20160529 Pepper SDK for Android Studio
20160529 Pepper SDK for Android Studio Kenichi Ohwada
 
Pepper sdk for android studio with mac
Pepper sdk for android studio with macPepper sdk for android studio with mac
Pepper sdk for android studio with mac篤 富田
 
iOSでのFramework導入のおさらい #関モバ
iOSでのFramework導入のおさらい #関モバiOSでのFramework導入のおさらい #関モバ
iOSでのFramework導入のおさらい #関モバSyo Ikeda
 
はじめてのReactiveCocoa
はじめてのReactiveCocoaはじめてのReactiveCocoa
はじめてのReactiveCocoa章平 福井
 

What's hot (9)

iOS豆知識ver0.0.5
iOS豆知識ver0.0.5iOS豆知識ver0.0.5
iOS豆知識ver0.0.5
 
Swift勉強会
Swift勉強会Swift勉強会
Swift勉強会
 
アジャイルジャパン長野サテライト
アジャイルジャパン長野サテライトアジャイルジャパン長野サテライト
アジャイルジャパン長野サテライト
 
20160529 30 android-workshop_upload
20160529 30 android-workshop_upload20160529 30 android-workshop_upload
20160529 30 android-workshop_upload
 
20160529 Pepper SDK for Android Studio
20160529 Pepper SDK for Android Studio 20160529 Pepper SDK for Android Studio
20160529 Pepper SDK for Android Studio
 
Pepper sdk for android studio with mac
Pepper sdk for android studio with macPepper sdk for android studio with mac
Pepper sdk for android studio with mac
 
iOSでのFramework導入のおさらい #関モバ
iOSでのFramework導入のおさらい #関モバiOSでのFramework導入のおさらい #関モバ
iOSでのFramework導入のおさらい #関モバ
 
はじめてのReactiveCocoa
はじめてのReactiveCocoaはじめてのReactiveCocoa
はじめてのReactiveCocoa
 
Chibapm01 lt
Chibapm01 ltChibapm01 lt
Chibapm01 lt
 

Viewers also liked

バグのことは嫌いになってもXcodeのことは嫌いにならないでください。
バグのことは嫌いになってもXcodeのことは嫌いにならないでください。バグのことは嫌いになってもXcodeのことは嫌いにならないでください。
バグのことは嫌いになってもXcodeのことは嫌いにならないでください。Daisuke Yamashita
 
TestFlightみたいなのを自作する
TestFlightみたいなのを自作するTestFlightみたいなのを自作する
TestFlightみたいなのを自作するTomoki Hasegawa
 
3D touch for iOS
3D touch for iOS3D touch for iOS
3D touch for iOStoyship
 
To learn Interpolator
To learn InterpolatorTo learn Interpolator
To learn InterpolatorMima Yuki
 
tvOSでWebSocketを使う
tvOSでWebSocketを使うtvOSでWebSocketを使う
tvOSでWebSocketを使うTomoki Hasegawa
 
Enhancements with 3D Touch
Enhancements with 3D TouchEnhancements with 3D Touch
Enhancements with 3D TouchSatoshi Ohki
 
MySQL 8.0で憶えておいてほしいこと
MySQL 8.0で憶えておいてほしいことMySQL 8.0で憶えておいてほしいこと
MySQL 8.0で憶えておいてほしいことyoku0825
 

Viewers also liked (9)

バグのことは嫌いになってもXcodeのことは嫌いにならないでください。
バグのことは嫌いになってもXcodeのことは嫌いにならないでください。バグのことは嫌いになってもXcodeのことは嫌いにならないでください。
バグのことは嫌いになってもXcodeのことは嫌いにならないでください。
 
Framework code reading
Framework code readingFramework code reading
Framework code reading
 
TestFlightみたいなのを自作する
TestFlightみたいなのを自作するTestFlightみたいなのを自作する
TestFlightみたいなのを自作する
 
3D touch for iOS
3D touch for iOS3D touch for iOS
3D touch for iOS
 
To learn Interpolator
To learn InterpolatorTo learn Interpolator
To learn Interpolator
 
UIKit Sound
UIKit SoundUIKit Sound
UIKit Sound
 
tvOSでWebSocketを使う
tvOSでWebSocketを使うtvOSでWebSocketを使う
tvOSでWebSocketを使う
 
Enhancements with 3D Touch
Enhancements with 3D TouchEnhancements with 3D Touch
Enhancements with 3D Touch
 
MySQL 8.0で憶えておいてほしいこと
MySQL 8.0で憶えておいてほしいことMySQL 8.0で憶えておいてほしいこと
MySQL 8.0で憶えておいてほしいこと
 

More from toyship

Time for Xcode Behavior
Time for Xcode BehaviorTime for Xcode Behavior
Time for Xcode Behaviortoyship
 
Notifications in iOS10
Notifications in iOS10Notifications in iOS10
Notifications in iOS10toyship
 
Universal Link
Universal LinkUniversal Link
Universal Linktoyship
 
Swift Protocol and Selector
Swift Protocol and SelectorSwift Protocol and Selector
Swift Protocol and Selectortoyship
 
Xcode7時代のアプリ配布
Xcode7時代のアプリ配布Xcode7時代のアプリ配布
Xcode7時代のアプリ配布toyship
 
My first tvOS
My first tvOSMy first tvOS
My first tvOStoyship
 
Contents blocker on iOS9
Contents blocker on iOS9Contents blocker on iOS9
Contents blocker on iOS9toyship
 
Embedded framework and so on
Embedded framework and so onEmbedded framework and so on
Embedded framework and so ontoyship
 
はじめてのWKInterfaceController
はじめてのWKInterfaceControllerはじめてのWKInterfaceController
はじめてのWKInterfaceControllertoyship
 
App extension for iOS
App extension for iOSApp extension for iOS
App extension for iOStoyship
 
サーバーからiOSアプリを変更する
サーバーからiOSアプリを変更するサーバーからiOSアプリを変更する
サーバーからiOSアプリを変更するtoyship
 
Xcode bot
Xcode botXcode bot
Xcode bottoyship
 
AVSpeechSynthesizerとロケール
AVSpeechSynthesizerとロケールAVSpeechSynthesizerとロケール
AVSpeechSynthesizerとロケールtoyship
 

More from toyship (13)

Time for Xcode Behavior
Time for Xcode BehaviorTime for Xcode Behavior
Time for Xcode Behavior
 
Notifications in iOS10
Notifications in iOS10Notifications in iOS10
Notifications in iOS10
 
Universal Link
Universal LinkUniversal Link
Universal Link
 
Swift Protocol and Selector
Swift Protocol and SelectorSwift Protocol and Selector
Swift Protocol and Selector
 
Xcode7時代のアプリ配布
Xcode7時代のアプリ配布Xcode7時代のアプリ配布
Xcode7時代のアプリ配布
 
My first tvOS
My first tvOSMy first tvOS
My first tvOS
 
Contents blocker on iOS9
Contents blocker on iOS9Contents blocker on iOS9
Contents blocker on iOS9
 
Embedded framework and so on
Embedded framework and so onEmbedded framework and so on
Embedded framework and so on
 
はじめてのWKInterfaceController
はじめてのWKInterfaceControllerはじめてのWKInterfaceController
はじめてのWKInterfaceController
 
App extension for iOS
App extension for iOSApp extension for iOS
App extension for iOS
 
サーバーからiOSアプリを変更する
サーバーからiOSアプリを変更するサーバーからiOSアプリを変更する
サーバーからiOSアプリを変更する
 
Xcode bot
Xcode botXcode bot
Xcode bot
 
AVSpeechSynthesizerとロケール
AVSpeechSynthesizerとロケールAVSpeechSynthesizerとロケール
AVSpeechSynthesizerとロケール
 

Recently uploaded

SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 

Recently uploaded (10)

SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 

What's new Swift3