Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Start using Swift.
Search
DAloG
January 14, 2016
Programming
150
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Start using Swift.
DAloG
January 14, 2016
Transcript
39 slides
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
More Decks by DAloG
See All by DAloG
State normalization (RU)
dalog
0
260
Redux + MQTT
dalog
1
840
От задач к проблемам
dalog
1
300
Unlimited power of Data-Driven UI
dalog
4
720
Data-Driven View Controllers. Tips and Tricks
dalog
5
2k
2 years of Redux in iOS. Lessons learned
dalog
0
440
Why unidirectional architecture matter for iOS.
dalog
1
350
Mobile backend without REST
dalog
2
160
Self managed teams 101
dalog
0
220
Other Decks in Programming
See All in Programming
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
350
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
110
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
310
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
750
オーケストレーション記述言語 Katari
yukikurage
0
250
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
180
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
370
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.3k
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
120
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
200
Crash Auto Pipelines
veronikapj
1
410
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1.7k
Featured
See All Featured
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
sira's awesome portfolio website redesign presentation
elsirapls
0
500
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
750
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
So, you think you're a good person
axbom
PRO
2
2.3k
Paper Plane
katiecoart
PRO
6
55k
Designing for humans not robots
tammielis
254
26k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
630
Embracing the Ebb and Flow
colly
88
5.2k