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
220
Rediscovering The Swift Compiler Through Closures
avielg
0
62
Other Decks in Programming
See All in Programming
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
970
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
200
Package Management Learnings from Homebrew
mikemcquaid
0
220
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
270
ぼくの開発環境2026
yuzneri
0
220
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
230
CSC307 Lecture 06
javiergs
PRO
0
690
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
130
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
280
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
Architectural Extensions
denyspoltorak
0
290
Featured
See All Featured
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
140
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
So, you think you're a good person
axbom
PRO
2
1.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
sira's awesome portfolio website redesign presentation
elsirapls
0
150
Build your cross-platform service in a week with App Engine
jlugia
234
18k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
82
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
200
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
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