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
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.9k
5分でわかるAdequateRecord
tmitz
1
480
Other Decks in Programming
See All in Programming
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
400
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
180
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
240
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
420
Ruby and LLM Ecosystem 2nd
koic
1
530
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
720
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
990
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
7.9k
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
270
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
250
「抽象に依存せよ」が分からなかった新卒1年目の私が Goのインターフェースと和解するまで
kurogenki
0
110
文字コードの話
qnighy
44
17k
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
540
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Accessibility Awareness
sabderemane
0
77
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
320
It's Worth the Effort
3n
188
29k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.8k
How to train your dragon (web standard)
notwaldorf
97
6.6k
Everyday Curiosity
cassininazir
0
160
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
630
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
130
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?