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
Start using Swift.
Search
DAloG
January 14, 2016
Programming
1
130
Start using Swift.
DAloG
January 14, 2016
Tweet
Share
More Decks by DAloG
See All by DAloG
State normalization (RU)
dalog
0
210
Redux + MQTT
dalog
1
780
От задач к проблемам
dalog
1
260
Unlimited power of Data-Driven UI
dalog
4
660
Data-Driven View Controllers. Tips and Tricks
dalog
5
2k
2 years of Redux in iOS. Lessons learned
dalog
0
380
Why unidirectional architecture matter for iOS.
dalog
1
300
Mobile backend without REST
dalog
2
120
Self managed teams 101
dalog
0
160
Other Decks in Programming
See All in Programming
レイトレZ世代に捧ぐ、今からレイトレを始めるための小径
ichi_raven
0
460
Stay Hacker 〜九州で生まれ、Perlに出会い、コミュニティで育つ〜
pyama86
2
2.3k
Rails Girls Sapporo 2ndの裏側―準備の日々から見えた、私が得たもの / SAPPORO ENGINEER BASE #11
lemonade_37
2
180
Developing Specifications - Jakarta EE: a Real World Example
ivargrimstad
0
140
「10分以内に機能を消せる状態」 の実現のためにやっていること
togishima
1
520
PHPライセンス変更の議論を通じて学ぶOSSライセンスの基礎
matsuo_atsushi
0
170
Flutterチームから作る組織の越境文化
findy_eventslides
0
520
PyCon mini 東海 2025「個人ではじめるマルチAIエージェント入門 〜LangChain × LangGraphでアイデアを形にするステップ〜」
komofr
3
1.1k
ゼロダウンタイムでミドルウェアの バージョンアップを実現した手法と課題
wind111
0
210
GraalVM Native Image トラブルシューティング機能の最新状況(2025年版)
ntt_dsol_java
0
160
Private APIの呼び出し方
kishikawakatsumi
3
890
2025 컴포즈 마법사
jisungbin
0
140
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
9.6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
A Tale of Four Properties
chriscoyier
162
23k
Balancing Empowerment & Direction
lara
5
760
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The Invisible Side of Design
smashingmag
302
51k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
The Language of Interfaces
destraynor
162
25k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
RailsConf 2023
tenderlove
30
1.3k
Transcript
20.01.2016 Forget Objective-C. Start Swift. for Kharkiv Mobile Devs #15
Alexey Demedetskiy ✤ twitter: @DAlooG ✤ email:
[email protected]
✤ skype:
nobidon
Objective-C ✤ KVO/KVC ✤ UIKit ✤ Monolithic namespace ✤ Partially
defined behavior ✤ CoreData
Swift ✤ Closures ✤ Immutability ✤ Value types ✤ Generics
✤ Optionals
Swift ✤ Protocols ✤ Nested types ✤ Static ✤ Default
values ✤ Operators
How to Swift? ✤ Add Swift to existing project ✤
Start new project
Why? ✤ Strong types —> Less errors ✤ More instruments
—> Cleaner code ✤ Better syntax —> Easy to read and write
Optionals vs ‘nil’
nil ✤ [nil aMessage:@«text»] - ✅ ✤ [list addObject:nil] -
❌
Optional<T> ✤ T! ✤ T? ✤ T
Dirty Types ✤ UIKit ✤ External data (Network etc) ✤
Objective-C
How to clear types? ✤ as? : Any -> T?
✤ as! : Any -> T
None
None
None
WTF Immutability. ✤ Reference and Value types ✤ let -
immutable name ✤ var - mutable name
Struct trickery ✤ How many objects will be created? ✤
How many times `print` will write? ✤ What `t1.b` will print?
Struct trickery ✤ 0. There is no objects. ✤ 1.
✤ 4.
Class trickery ✤ How many objects will be created? ✤
How many times `print` will write? ✤ What `t1.b` will print?
Class trickery ✤ 1 ✤ 1 ✤ -1
let == const?
let == const?
Value types Pros ✤ Immutable. Even with `var` ✤ `init`
from compiler ✤ No inheritance
Properties ✤ no setter / getter methods. ✤ …unless `dynamic`
is specified ✤ `willSet` / `didSet` with references to new/old values ✤ `public private(set) var …` is ok
enum vs NS_ENUM
enum vs NS_ENUM
Shadow types!
None
None
When use enum? ✤ Flags ✤ States ✤ Options ✤
Shadow type
Alamofire vs AFNetworking
Namespaces ✤ Nested types ✤ Frameworks ✤ Targets
Nested types
Nested types
Nested types
Nested types
Nested types
let = vs dispatch_once
Outro ✤ Run away from Obj-C ✤ Build your own
logic modules ✤ Use Value Types ✤ Don’t use generics + inheritance + UIKit