What's new Swift3

290
-1

Published on

About Swift2.2 and Swift 3.0

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
290
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

What's new Swift3

  1. 1. What's new in Swift3 @TachibanaKaoru 2015/12/16 @TachibanaKaoru, 2015 1
  2. 2. 自己紹介 渋谷のVOYAGE GROUPでiOSエンジ ニアをしています。 Twitter: @TachibanaKaoru Blog : http://www.toyship.org/ @TachibanaKaoru, 2015 2
  3. 3. VOYAGE GROUP 4 appetiというグルメアプリや、朝 時間.jpという朝時間活用アプリな どをだしてます。 @TachibanaKaoru, 2015 3
  4. 4. try! Swift 4 2016/3/2~3/4 at Shibuya 4 http://tryswiftconf.com/ 4 VOYAGE GROUP はtry Swiftのスポンサーです。 @TachibanaKaoru, 2015 4
  5. 5. Swift is Open Source @TachibanaKaoru, 2015 5
  6. 6. Swift is Open Source @TachibanaKaoru, 2015 6
  7. 7. @TachibanaKaoru, 2015 7
  8. 8. Swift Evolution Swiftのソースコードがオープンソースになっただけではな く、今後のSwiftの新規機能の議論もオープンされ、自由に参 加できるようにもなりました。 @TachibanaKaoru, 2015 8
  9. 9. Swift Evolution @TachibanaKaoru, 2015 9
  10. 10. @TachibanaKaoru, 2015 10
  11. 11. 前回のSwiftのメジャーバ ージョンアップをふりか えってみると…… @TachibanaKaoru, 2015 11
  12. 12. WWDC 2015でSwift 2.0 とiOS9が発表 @TachibanaKaoru, 2015 12
  13. 13. 早くiOS9の機能を使いた い! @TachibanaKaoru, 2015 13
  14. 14. iOS9の新機能を使うため には、最新のXcodeを使 う必要があり、Swiftが 強制的に1.2 -> 2.0にバー ジョンアップされる。 @TachibanaKaoru, 2015 14
  15. 15. Swift 1.2とSwift 2.0には コード互換性がない! @TachibanaKaoru, 2015 15
  16. 16. Swift 1.2 -> 2.0のマイグ レーションツールが(一 応)あったけど、まとも に動かず、結局手動でソ ースコード修正 @TachibanaKaoru, 2015 16
  17. 17. \(^o^)/ @TachibanaKaoru, 2015 17
  18. 18. 次回はそうならないよう に、Swift Evolutionの内 容から、今後のSwiftの ロードマップを予習して いきましょう。 @TachibanaKaoru, 2015 18
  19. 19. Swift 2.2 @TachibanaKaoru, 2015 19
  20. 20. Swift 2.2 まず、2016年春に、Swift 2.2のリリースが予定されています 4 バグ修正、実装の品質向上、(warning messageなど)、 コンパイル時間改善、パフォーマンス改善 4 コード互換性あり。 4 3.0のリリースを見据えて、将来のコード変更に対する warningを表示するようになる @TachibanaKaoru, 2015 20
  21. 21. Swift 3.0 @TachibanaKaoru, 2015 21
  22. 22. Swift 3.0 2016年秋に、Swift 3.0のリリースが予定されています。 言語と標準ライブラリのバイナリレベルでのインターフェース を安定させることが目的。 2系バージョンからのコードレベルの互換性はありません。 @TachibanaKaoru, 2015 22
  23. 23. 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
  24. 24. Swift 3.0で対応しないこと 4 2系Swiftとのソースレベルの互換性 4 並列処理の言語サポート 4 C++との互換性、マクロ 4 標準ライブラリの拡張 @TachibanaKaoru, 2015 24
  25. 25. Proposals これからSwiftに導入される機能はProposal単位で検討され ています。 @TachibanaKaoru, 2015 25
  26. 26. Proposals @TachibanaKaoru, 2015 26
  27. 27. @TachibanaKaoru, 2015 27
  28. 28. Proposalとは。 今後のSwiftに追加したい or 削除したい機能の提案です。 どのProposalを採用するかどうかの議論は、swift- revolution-mlで行われており、誰でも参加することができま す。 (もちろんProposalの提案も!) @TachibanaKaoru, 2015 28
  29. 29. 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
  30. 30. 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
  31. 31. What is 'proposals 現在14件中、Swift2.2での採用が1件、Swift3.0での採用が5 件。 それ以外は検討中です。 @TachibanaKaoru, 2015 31
  32. 32. [0001] Allow keywords as argument labels 4 Status: Swift2.2で採用 4 Author: Doug Gregor inやrepeatやdeferなどのキーワードとして使われていた単 語を変数のラベル名に利用することができるようになる。 (inout,var,let以外のすべての単語が使えるようになる) @TachibanaKaoru, 2015 32
  33. 33. 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
  34. 34. [0002] Removing currying func declaration syntax Status: Swift3.0で採用 Author(s): Joe Groff カリー化の簡易記法がなくなる。 (カリー化ができなくなるということではありません。) @TachibanaKaoru, 2015 34
  35. 35. カリー化とは 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
  36. 36. // 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
  37. 37. [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
  38. 38. [0004] Remove the ++ and -- operators Status: Swift3.0で採用 Author: Chris Lattner ++と--をなくしましょう! (Proposal7とも関連) @TachibanaKaoru, 2015 38
  39. 39. Finally, these fail the metric of "if we didn't already have these, would we add them to Swift 3?" @TachibanaKaoru, 2015 39
  40. 40. [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
  41. 41. [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
  42. 42. [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
  43. 43. 4 これ以降のProposalはレビュー待ち... 4 そして、これ以外のproposalも続々出されています。 4 swift-revolution-mlを読んで次世代Swiftの準備をしよ う! @TachibanaKaoru, 2015 43
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×