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
TCA with UIKit [TCAでわいわいLT会]
Search
tatsubee
March 18, 2024
1.4k
1
Share
TCA with UIKit [TCAでわいわいLT会]
tatsubee
March 18, 2024
More Decks by tatsubee
See All by tatsubee
マルチウィンドウ実践ガイド
shoryuyamamoto
0
270
Create Spatial Photo with ImagePresentationComponent
shoryuyamamoto
0
100
pixivのリアーキテクチャにおける The Composable Architecter活用
shoryuyamamoto
0
200
pixivアプリは変化する
shoryuyamamoto
0
1.1k
マルチウィンドウでアプリケーションの表現を拡張する
shoryuyamamoto
1
380
【After iOSDC LT Night〜ピクシブ×日経×タイミー〜】実装!Interactive Widgets
shoryuyamamoto
0
69
SwiftPM マルチモジュール構成への第一歩
shoryuyamamoto
0
3.2k
Dart Macrosに願いを [YOUTRUST x ゆめみ Flutter LT会@渋谷 #4]
shoryuyamamoto
0
890
riverpodを理解したい
shoryuyamamoto
0
190
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Tell your own story through comics
letsgokoyo
1
920
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
280
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
690
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
130
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.4k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
320
We Have a Design System, Now What?
morganepeng
55
8.1k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
500
Designing for humans not robots
tammielis
254
26k
Transcript
Presented by 辰べえ 2024.03.18 Presented by 辰べえ TCA with UIKit
辰べえ iOSエンジニア 辰べえ iOSエンジニア 2 自己紹介 • 23新卒 • 福岡生まれ
福岡育ち 東京在住 • 最近やっていること ◦ お絵描き ◦ テニス ◦ iOS
UIKitでTCAを使うことを考える 3
UIKitでTCAを使うことを考える • 「TCAはSwiftUIで使うもの」という印象がある 4
UIKitでTCAを使うことを考える • 「TCAはSwiftUIで使うもの」という印象がある • しかし新規のプロダクトをSwiftUIで実装するならともかく、 以前からあるプロダクトでUIKit→SwiftUIの移行を今すぐに行うことは 容易ではない 5
UIKitでTCAを使うことを考える • 「TCAはSwiftUIで使うもの」という印象がある • しかし新規のプロダクトをSwiftUIで実装するならともかく、 以前からあるプロダクトでUIKit→SwiftUIの移行を今すぐに行うことは 容易ではない • じゃあUIKitではTCAはどのように使えるんだろう? 6
UIKitでTCAを使うことを考える • 「TCAはSwiftUIで使うもの」という印象がある • しかし新規のプロダクトをSwiftUIで実装するならともかく、 以前からあるプロダクトでUIKit→SwiftUIの移行を今すぐに行うことは 容易ではない • じゃあUIKitではTCAはどのように使えるんだろう? •
後世、UIKitからSwiftUIに移行することを前提として、あらかじめTCA を導入することも一つの手では? 7
UIKitにおけるTCAの基本的な実装 8
9 Reducerの実装
10 Storeの保持
11 Actionの実行
12 State変更時
注意点 13
14 状態の変化によって まとめて実行される
15 ←重い処理
16 処理の単位で分割! ←重い処理
UIKitからSwiftUIへの移行 17
UIKitからSwiftUIへの移行 18 UIKitからSwiftUIへの移行が簡単にできるか?
UIKitからSwiftUIへの移行 19 UIKitからSwiftUIへの移行が簡単にできるか? →場合による
UIKitからSwiftUIへの移行 20 ユーザーが実行するアクションが単純な場合: 移行は比較的簡単
UIKitからSwiftUIへの移行 21 アクションが複雑な場合: SwiftUI側に機能が足りていない場合がある
まとめ 22 • UIKitにTCAを採用することができるか? ◦ ◎ ◦ そもそもUIKitでも使いやすいよう作られている • 後々、UIKitからSwiftUIに移行しやすいか?
◦ ◦ ◦ 単純な機能(Tap等)であればReducerはそのまま移行できる ◦ 複雑な機能(Drag&Drop等)だと、ロジックの改修を必要とする場合がある ▪ とはいえ、Reducerの形は大きく変わらないので改修も難しくない(かも)
ご清聴 ありがとうございました! 23