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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
DAloG
January 14, 2016
Programming
140
1
Share
Start using Swift.
DAloG
January 14, 2016
More Decks by DAloG
See All by DAloG
State normalization (RU)
dalog
0
240
Redux + MQTT
dalog
1
820
От задач к проблемам
dalog
1
290
Unlimited power of Data-Driven UI
dalog
4
700
Data-Driven View Controllers. Tips and Tricks
dalog
5
2k
2 years of Redux in iOS. Lessons learned
dalog
0
410
Why unidirectional architecture matter for iOS.
dalog
1
330
Mobile backend without REST
dalog
2
140
Self managed teams 101
dalog
0
200
Other Decks in Programming
See All in Programming
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
710
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
130
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
140
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
170
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
690
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.5k
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
180
エージェンティックRAGにAWSで入門しよう!
har1101
5
110
Lessons from Spec-Driven Development
simas
PRO
0
130
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.6k
Modding RubyKaigi for Myself
yui_knk
0
880
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
100
Featured
See All Featured
Music & Morning Musume
bryan
47
7.2k
YesSQL, Process and Tooling at Scale
rocio
174
15k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
Context Engineering - Making Every Token Count
addyosmani
9
930
Test your architecture with Archunit
thirion
1
2.3k
Marketing to machines
jonoalderson
1
5.3k
My Coaching Mixtape
mlcsv
0
140
Mind Mapping
helmedeiros
PRO
1
230
The Curse of the Amulet
leimatthew05
1
13k
Making the Leap to Tech Lead
cromwellryan
135
9.9k
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