Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Swift2 New Features
Search
Tomohiro MITSUMUNE
August 14, 2015
Programming
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Swift2 New Features
社内向けの発表資料。
あまりiOSさわったことない人向けの解説です。
Tomohiro MITSUMUNE
August 14, 2015
Transcript
20 slides
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?
More Decks by Tomohiro MITSUMUNE
See All by Tomohiro MITSUMUNE
某サービスのリニューアルでECSを導入したよもやま話
tmitz
1
3k
5分でわかるAdequateRecord
tmitz
1
480
Other Decks in Programming
See All in Programming
AI Augmentation Techniques with Liberty
ivargrimstad
1
560
RaspberryPi 5で軽くはじめるk3sとtailscaleを用いたホームサーバー構築 (1)
nasum
0
440
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
270
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
JavaScriptはシングルバイナリの夢を見るか / Does JavaScript Dream of a Single Binary?
ssssota
0
130
AppFunctionsの内部実装を紐解く
hiroaki404
0
120
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
300
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
230
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
390
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
150
はじめてのPLATEAU
nokonoko1203
1
670
Secure Your Coding Agent Like It’s Malware (v1.5) 🇬🇧 @Code.talks 2026
richargh
0
200
Featured
See All Featured
Exploring anti-patterns in Rails
aemeredith
4
580
GraphQLとの向き合い方2022年版
quramy
50
15k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.5k
Agile that works and the tools we love
rasmusluckow
331
22k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
550
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
43k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
How GitHub (no longer) Works
holman
316
150k