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
Swifty Code: The Real World
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Aviel Gross
August 03, 2016
Programming
0
200
Swifty Code: The Real World
Keynote of the lecture given at iOS TLV Meetup on August 3 2016 by Aviel Gross
Twitter: @avielgr
Aviel Gross
August 03, 2016
Tweet
Share
More Decks by Aviel Gross
See All by Aviel Gross
SwiftUI Performance for Demanding Apps
avielg
0
220
Rediscovering The Swift Compiler Through Closures
avielg
0
62
Other Decks in Programming
See All in Programming
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
940
CSC307 Lecture 07
javiergs
PRO
0
530
高速開発のためのコード整理術
sutetotanuki
1
360
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
120
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
330
CSC307 Lecture 02
javiergs
PRO
1
770
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
[AI Engineering Summit Tokyo 2025] LLMは計画業務のゲームチェンジャーか? 最適化業務における活⽤の可能性と限界
terryu16
2
600
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.1k
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
390
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
97
6.5k
Making Projects Easy
brettharned
120
6.6k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
61
49k
Leo the Paperboy
mayatellez
4
1.4k
We Are The Robots
honzajavorek
0
150
The SEO Collaboration Effect
kristinabergwall1
0
340
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
84
The Limits of Empathy - UXLibs8
cassininazir
1
210
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
48
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
51
Transcript
SWIFTY SWIFTIFICATIONS FOR SWIFT SWIFTTIBUTES *Texts in this keynote where
written in some fonts that are not San-Francisco, please accept my sincere apology.
Swifty Code
None
OO IS OLD! PROTOCOL ORIENTED IS GOLD! USE STRUCTS NOT
CLASSES! IT’S NOT FUNCTIONAL ENOUGH! I HEARD APPLE HAS THAT NEW SWIFT LANG…WHATS ALL THAT ABOUT?
None
None
None
None
None
None
None
None
None
None
None
None
None
None
Class or Struct?!
MAINLY LOGIC OR MODEL? CLASS Logic Model BIG/NOT- SELF CHANGES?
Yes CLASS No STRUCT MIGHT WORK REFERENC ING A CLASS? Yes CLASS No
The Almighty Swift Enum
Swift ❤ enums - Holds values (even named!) - $
Can implement Protocols - Very light! (both on syntax and system)
Swift ❤ enums - Knows who he is!
Swift ❤ enums - Check for specific case
Swift ❤ enums - Or handle all of them +
their values
Swift ❤ enums Enums can even be your model!
Swift ❤ enums TL;DR Use Enums! And don’t buy a
MBA
try/catch Quoted from hackingwithswift.com/new-syntax-swift-2-error-handling-try-catch
Guard
Spot the success! Quoted from nshipster.com/guard-and-defer
Quoted from nshipster.com/guard-and-defer
Use Guard - Verify condition/unwrap needed optional - Early failure
- empty/zero/default result Don’t Use Guard - ‘else’ has logic - Entire func is a tiny if-else
Defer
None
Custom Operations
- associativity & precedence - val X val X val
- X= version - Accepts optionals? - Returns optional? - $ test
None
☝
Overloading
None
“Don't leave "broken windows" unrepaired. ” - The Pragmatic Programmer
Not var! Use “half dynamic” lets
Not string! Use the new #selector
use Swift switch Change this…..
To This: use Swift switch
FAKE IT FAKE IT UNTIL YOU MAKE IT