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
320
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
400
Ruby 型別檢查工具簡介
johnlinvc
0
630
Swift Actor 實作探索
johnlinvc
0
200
用 mruby 來寫跨平台工具
johnlinvc
0
130
Actor model 簡介
johnlinvc
0
240
一起玩 Helm 3
johnlinvc
1
160
為什麼 App 卡卡的
johnlinvc
2
1.3k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
270
Other Decks in Programming
See All in Programming
Building a Meta Ray-Ban display app
akkeylab
0
170
SlackアプリとLambdaの 連携を構築した話
pawn_4_s
1
130
FDEが実現するAI駆動経営の現在地
gonta
2
290
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
240
引き算の組織 ― アウトカムとAIに全振りするために辞めたこと ― / Organization by Subtraction
hirokiyamamoto14
PRO
0
250
今さら聞けない .NET CLI
htkym
0
200
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
19k
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
430
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
0
140
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
210
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
580
yield再入門 #phpcon
o0h
PRO
0
1.2k
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
5.1k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
350
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
45k
The Cult of Friendly URLs
andyhume
79
7k
New Earth Scene 8
popppiees
3
2.5k
Everyday Curiosity
cassininazir
0
290
So, you think you're a good person
axbom
PRO
2
2.1k
Rails Girls Zürich Keynote
gr2m
96
14k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
The Curious Case for Waylosing
cassininazir
1
460
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
620
Navigating Team Friction
lara
192
16k
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/