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
120
Start using Swift.
DAloG
January 14, 2016
Tweet
Share
More Decks by DAloG
See All by DAloG
State normalization (RU)
dalog
0
170
Redux + MQTT
dalog
1
760
От задач к проблемам
dalog
1
240
Unlimited power of Data-Driven UI
dalog
4
620
Data-Driven View Controllers. Tips and Tricks
dalog
5
1.9k
2 years of Redux in iOS. Lessons learned
dalog
0
350
Why unidirectional architecture matter for iOS.
dalog
1
280
Mobile backend without REST
dalog
2
94
Self managed teams 101
dalog
0
130
Other Decks in Programming
See All in Programming
ASP.NETアプリケーションのモダナイゼーションについて
tomokusaba
0
260
Jakarta EE Meets AI
ivargrimstad
0
860
ComposeでのPicture in Picture
takathemax
0
130
Optimizing JRuby 10
headius
0
580
AIコーディングの理想と現実
tomohisa
36
39k
iOSアプリで測る!名古屋駅までの 方向と距離
ryunakayama
0
160
ニーリーQAのこれまでとこれから
nealle
2
720
AIコーディングエージェントを 「使いこなす」ための実践知と現在地 in ログラス / How to Use AI Coding Agent in Loglass
rkaga
4
1.3k
一緒に働きたくなるプログラマの思想 #QiitaConference
mu_zaru
80
21k
By the way Google Cloud Next 2025に行ってみてどうだった
ymd65536
0
120
REALITY コマンド作成チュートリアル
nishiuriraku
0
120
2025-04-25 GitHub Copilot Agent ライブデモ(スクリプト)
goataka
0
110
Featured
See All Featured
Building Applications with DynamoDB
mza
94
6.4k
Building an army of robots
kneath
305
45k
Into the Great Unknown - MozCon
thekraken
38
1.7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
179
53k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
52
2.5k
Automating Front-end Workflow
addyosmani
1370
200k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
RailsConf 2023
tenderlove
30
1.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
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