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
Swift2 New Features
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Tomohiro MITSUMUNE
August 14, 2015
Programming
0
140
Swift2 New Features
社内向けの発表資料。
あまりiOSさわったことない人向けの解説です。
Tomohiro MITSUMUNE
August 14, 2015
Tweet
Share
More Decks by Tomohiro MITSUMUNE
See All by Tomohiro MITSUMUNE
某サービスのリニューアルでECSを導入したよもやま話
tmitz
1
2.8k
5分でわかるAdequateRecord
tmitz
1
470
Other Decks in Programming
See All in Programming
dchart: charts from deck markup
ajstarks
3
990
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
SourceGeneratorのススメ
htkym
0
190
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
110
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
640
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.5k
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
CSC307 Lecture 07
javiergs
PRO
0
550
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
Fluid Templating in TYPO3 14
s2b
0
130
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
990
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
97
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
54
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
250
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
170
RailsConf 2023
tenderlove
30
1.3k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
57
50k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3k
It's Worth the Effort
3n
188
29k
Transcript
Swift2 New Features @t_mitz 2015/08/12
Agenda • Error Handling • Protocol Extension • New keywords
& Renamed syntax • Swift-er SDK
Error Handling • do ~ catch ͱ try Λ͏ •
ॏཁɿྫ֎ॲཧͰͳ͍Ͱ͢ • ࠓ·ͰͷNSErrorͷΓํͷSyntax Sugerͱߟ ͑ͯΒͬͯΑͦ͞͏
Error Type • enumܕͰΤϥʔλΠϓΛఆٛ
Throwing Errors • func ~ throws {} ͰΤϥʔΛ͛ΔՄೳੑͷ͋ ΔfuncΛఆٛ͢Δ
Catching & Handling Errors • do ~ catchͷதͰ try func()
ͯ͠catchͰΤϥʔ Λर͏
ͳʹ͕͏Ε͍͠ͷ͔ • طଘͷΤϥʔϋϯυϦϯά • NSErrorͷϙΠϯλ͠Ͱ͕ΜΔ • ਖ਼ৗܥͱҟৗܥ͕΄ͲΑࠞ͘͟Γ͍͢ • ίʔυॻ͘ਓͷηϯε࣍ୈ •
୭͕ॻ͍ͯਖ਼ৗܥɾҟৗܥ͕͞ΕΔίʔυʹͳ ΔͷεςΩ
Protocol Extension
Protocol • JavaͰ͍͏Interface
Protocol Extension • protocolʹରͯ͠ॳظϝιουΛՃͰ͖Δ
ݺͼग़͠ͷ݁Ռ
ͳʹ͕͏Ε͍͠ͷ͔ • SwiftͰඪ४Ͱఆٛ͞ΕΔΦϒδΣΫτ ProtocolΛ࣮ͬͯ͞Ε͍ͯΔ • ඪ४ProtocolϢʔβʔ͕ExtensionՄೳ • ֦ுϥΠϒϥϦͭ͘Δͱ͖ʹΜΓ
New Keywords
guard • ͍ΘΏΔΨʔυઅ͕ॻ͚Δ܅ • assign͞ΕΔ͕nilͩͬͨΒείʔϓͷ ॲཧʹೖΔ • if let ~
ͱͷҧ͍assignʹޭ͢Δͱείʔ ϓͷ֎Ͱ͑Δ͜ͱ
guard statement
defer • ݱࡏͷείʔϓΛൈ͚ΔલͰݺΕΔ • Error Handlingͱ߹Θͤͯ͏ͱ͖Finallyͱ ͯ͑͠Δ • cleanupॲཧΛॻ͖͍ͨͱ͖ʹΜΓ
defer statement
available • OSͷόʔδϣϯͰذͤ͞Δ܅ • iOS 8.4 ͱ͔ϚΠφʔόʔδϣϯ
repeat • ͍ΘΏΔ do ~ whileจ
Any Question?