Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
實戰 Swift 3 升級
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Johnlin
October 04, 2016
Programming
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
實戰 Swift 3 升級
Johnlin
October 04, 2016
More Decks by Johnlin
See All by Johnlin
用 MLIR 實作 一個 Ruby IR (intermediate representation)
johnlinvc
0
300
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
390
Ruby 型別檢查工具簡介
johnlinvc
0
620
Swift Actor 實作探索
johnlinvc
0
200
用 mruby 來寫跨平台工具
johnlinvc
0
120
Actor model 簡介
johnlinvc
0
240
一起玩 Helm 3
johnlinvc
1
160
為什麼 App 卡卡的
johnlinvc
2
1.3k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
260
Other Decks in Programming
See All in Programming
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
650
20260623_Loop Engineeringで自分の分身の問い合わせBotを作る
ryugen04
0
220
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
380
フィードバックで育てるAI開発
kotaminato
1
120
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
430
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
500
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
3.8k
AIエージェントで 変わるAndroid開発環境
takahirom
2
680
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
1.1k
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
140
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
2.7k
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
2.6k
Featured
See All Featured
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
280
Technical Leadership for Architectural Decision Making
baasie
3
440
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
510
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
310
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Exploring anti-patterns in Rails
aemeredith
3
440
Building the Perfect Custom Keyboard
takai
2
810
We Have a Design System, Now What?
morganepeng
55
8.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Building Adaptive Systems
keathley
44
3.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Transcript
መፌSwift 3 ঋڃ @johnlinvc
Swift 3 • Swift 2.2 ൺɼՃྃଟత౦ɼमվྃ ଟ౦ɻ • Xcode
8 తҰ෦㟨 • ࠷ޙঋڃظݶະ
None
खಈঋڃ • ࣗݾվॴ༗తఔࣜᛰɻ • ࣗቮमશແ๏ཧղత Build settingɻ
None
༻Xcode ঋڃ۩ • ୈҰ࣍༻ Xcode 8 ଧ։ݱ༗ሢҊब။ग़ݱɻ • ՄҎࣗಈ㢨㟬मվఔࣜᛰ Swift
3 ൛ຊɼؐ༗मվ Build settingsɻ
None
None
༻ঋڃ۩త४උ࡞ • ֬อఔࣜࡏXcode 7.3 ੋਖ਼ৗӡ࡞తɻ • ֬อॴ༗త Target ࡏ Scheme
ཫɻ • ༗ Test తबଠྃɻ
༻ঋڃ۩ • ՄҎબᎩཁঋ౸ Swift 2.3 ҃ੋ Swift 3.0 • ။ઌ
Build Ұ࣍ိ֬ఆཁࣗಈमվతํɻ • ࠷ޙ҈ Save ब။ঋڃɻ
Demo
None
Xcodeෆੋᤈೳత • ൺֱগਓ။༻త ޠ๏/API बᔒ༗ࣗಈঋڃɻ • ೳⴺखಈमվɻ
SetIndex & DictionaryIndex • index.successor() Ꮣ Collection.index(after: index) • index.predecessor()
Ꮣ Collection.index(before: index) • index.advancedBy(delta) Ꮣ Collection.index(index, offsetBy: delta) • index.advancedBy(delta, limit: otherIndex) Ꮣ Collection.index(index, offsetBy: delta, limitedBy: otherIndex) • index.distanceTo(otherIndex) Ꮣ Collection.distance(from: index, to: otherIndex)
ࣗݾሜత Collection Type • ݱࡏ Indexing ੋ༝ Collection ཧɻ •
ࣗݾሜత Collection Type ཁࣗݾमվɻ • ී௨త Collection धཁ Collection.index(after: index) • ძత धཁ Collection.index(before: index) • ᬋػଘऔత धཁ Collection.index(index, offsetBy: delta, limitedBy: otherIndex) Collection.distance(from: index, to: otherIndex)
Range త मվ • ݱࡏ Range ෆೳඃ iterate (for-in)ྃɼ༗ CountableRange
ՄҎɻ • ೭લ༗໌֬એࠂ Range తՄҎߟྀվ CountableRangeɻ
Collection 㚎ݐ min/max • Ҏલೳࣗݾ༻ extension Ճɻ • ୠੋݱࡏ㚎ݐ೭ޙ။໊ɻ
NSURL & NSData • ݱࡏ༗ਖ਼ࣜతSwift ൛ຊɼURL & Dataɻ • େ෦။ࣗಈঋڃɼআඇ༗༻౸ෆࢧԉత
APIɻ • ૾ੋ checkResourceIsReachableAndReturnError ब վ။㟚Exception త checkResourceIsReachable
NSMutable* • ૾ੋ NSMutableDataɻ • ෆ။ࣗಈঋڃ • ୠੋ৽తAPI ෆ٣ɼೳⴺखಈ myData
as Data
զ༗༻Cocoapods/Carthage 1. ᠃༻Swift 2.2 & Xcode 7.3 ౸ॴ༗ Package
ঋڃɻ 2. ሜ৴/ᚙ Tweet ڈޑჄݪ࡞ऀɻ 3. 㢨ଞम೭ޙᚙ Pull Requestɻ
CI ઃఆཁঋڃ • CocoaPods 㗞ੜग़ိత workspace ᔒ༗ඪهቮঋڃ • ࡏCI ্။༗ɻ
• ༻ beta ൛ Cocoapods ɼ $ [sudo] gem install cocoapods --pre • ՃҰݸ㚎༰ੋ 3.0 త .swift-version 䈕څ CI ɻ
Q&A • ํঋڃจ݅ https://swift.org/migration-guide/ • (෦㟨)தจ൛ https://swiftlang.tw/migration-guide/