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
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
210
Rediscovering The Swift Compiler Through Closures
avielg
0
60
Other Decks in Programming
See All in Programming
Core MIDI を勉強して作曲用の電子ピアノ作ってみた!
hypebeans
0
110
無秩序からの脱却 / Emergence from chaos
nrslib
0
680
AIの弱点、やっぱりプログラミングは人間が(も)勉強しよう / YAPC AI and Programming
kishida
9
4.8k
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
160
Dive into Triton Internals
appleparan
0
490
最新のDirectX12で使えるレイトレ周りの機能追加について
projectasura
0
250
予防に勝る防御なし(2025年版) - 堅牢なコードを導く様々な設計のヒント / Growing Reliable Code PHP Conference Fukuoka 2025
twada
PRO
39
12k
モビリティSaaSにおけるデータ利活用の発展
nealle
0
450
知られているようで知られていない JavaScriptの仕様 4選
syumai
0
610
Eloquentを使ってどこまでコードの治安を保てるのか?を新人が考察してみた
itokoh0405
0
3.2k
flutter_kaigi_2025.pdf
kyoheig3
1
330
「正規表現をつくる」をつくる / make "make regex"
makenowjust
1
470
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Into the Great Unknown - MozCon
thekraken
40
2.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
670
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Practical Orchestrator
shlominoach
190
11k
Designing for Performance
lara
610
69k
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