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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
tatsubee
March 18, 2024
1
1.4k
TCA with UIKit [TCAでわいわいLT会]
tatsubee
March 18, 2024
Tweet
Share
More Decks by tatsubee
See All by tatsubee
マルチウィンドウ実践ガイド
shoryuyamamoto
0
240
Create Spatial Photo with ImagePresentationComponent
shoryuyamamoto
0
92
pixivのリアーキテクチャにおける The Composable Architecter活用
shoryuyamamoto
0
180
pixivアプリは変化する
shoryuyamamoto
0
1.1k
マルチウィンドウでアプリケーションの表現を拡張する
shoryuyamamoto
1
350
【After iOSDC LT Night〜ピクシブ×日経×タイミー〜】実装!Interactive Widgets
shoryuyamamoto
0
64
SwiftPM マルチモジュール構成への第一歩
shoryuyamamoto
0
3.2k
Dart Macrosに願いを [YOUTRUST x ゆめみ Flutter LT会@渋谷 #4]
shoryuyamamoto
0
860
riverpodを理解したい
shoryuyamamoto
0
170
Featured
See All Featured
Everyday Curiosity
cassininazir
0
170
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
560
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
200
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
190
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
100
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
140
Game over? The fight for quality and originality in the time of robots
wayneb77
1
140
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
210
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
150
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
450
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
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