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
Migrating from UIKit to SwiftUI efficiently
Search
yhkaplan
September 20, 2020
Programming
3.9k
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Migrating from UIKit to SwiftUI efficiently
yhkaplan
September 20, 2020
More Decks by yhkaplan
See All by yhkaplan
Using the latest UICollectionView APIs
yhkaplan
0
3.4k
Swift and Concurrency: The Plan for World Domination
yhkaplan
0
210
Backend-Driven UI: Making Screens Dynamic
yhkaplan
1
1.9k
Property Wrappers
yhkaplan
0
620
Parser Combinators
yhkaplan
0
310
The Great Swift Migration
yhkaplan
1
4.2k
Speeding Up Your CI
yhkaplan
0
520
Automate All the Things
yhkaplan
4
2.6k
Other Decks in Programming
See All in Programming
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
110
20260623_Loop Engineeringで自分の分身の問い合わせBotを作る
ryugen04
0
200
スマートグラスで並列バイブコーディング
hyshu
0
290
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
140
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
140
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
2
840
Haskell/Servantを通してWebミドルウェアを捉え直す
pizzacat83
1
480
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
480
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
510
act2-costs.pdf
sumedhbala
0
110
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
270
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
260
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
Building Applications with DynamoDB
mza
96
7.1k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
420
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
180
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
190
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
320
Optimising Largest Contentful Paint
csswizardry
37
3.8k
The Curse of the Amulet
leimatthew05
2
13k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
490
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
Marketing to machines
jonoalderson
1
5.6k
Transcript
Migrating from UIKit to Swi!UI efficiently final class MyViewController: UITableViewController
{ private var data = [String]() override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell") let d = data[indexPath.row] cell?.textLabel?.text = d return cell ?? UITableViewCell() } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return data.count } } ↓ struct MyView: View { private var data = [String]() var body: some View { List(data, id: \.self) { d in Text(d) } } } 1
Self Intro — Name: Joshua Kaplan — Work: minne @
GMO Pepabo — Interests: ! CI/CD, " frameworks, and more — Hobbies: # bread, $ history, and running 2
Intro 1. Why move to SwiftUI? 2. Why not move
to SwiftUI? 3. Modernize Swift Usage 4. Modernize UIKit usage 5. Plan and prototype 6. Two approaches 7. Tips 3
Why move to Swi!UI — Do more with less code
(for most things) — Easier to implement — The future of GUI development 4
Why not move to Swi!UI — Stability — iOS 12
and less compatibility — Low-level or high performance needs — Mixing can be difficult and painful without planning — How urgent? 5
Modernize Swi! usage — Migrate from Objective-C! — Use latest
Swift version — Use Swiftier conventions — Use all the latest features — Get familiar with FRP frameworks 6
Modernize UIKit usage — Use auto layout — Support safe
area — Components — Thin or no storyboards — Dynamic type and dark mode — Use declarative UIKit APIs 7
Plan and prototype 8
Prototype — Make a prototype — Identify screens/components not suited
to SwiftUI — Change the design — Make an iOS 13-only feature 9
Architecture — Redux — The Composable Architecture (TCA) — MVVM
10
Two approaches 11
12
Tips — Don't mix too much — Start with easier
screens — Don’t hurry — Study SwiftUI and Combine in advance 13
Conclusion 14
Thank you 15
Reference 16
Prototype — Shop.app 17
Combine 18
Docs — Official Documentation — RxSwift to Combine Cheatsheet —
CombineϑϨʔϜϫʔΫ·ͱΊ 19
Code — CombineSwiftPlayground — Combine-MVVM — OpenCombine 20
Video — Introducing Combine — Combine in Practice 21
Books — Using Combine — Practical Combine — Understanding Combine
— Combine: Asynchronous Programming with Swift 22
Swi!UI — Official Documentation 23
Books — Thinking in SwiftUI — SwiftUI by Tutorials 24