SlideShare a Scribd company logo
スケーラブル SwiftUI プロジェクトのための
実⽤的な TCA 適用及びモジュール化
Principles of building robust module
KyuYoung Heo
@bbvch13531
iOS Developer
目次
• デモ
• Declarative UI and SwiftUI
• The Composable Architecture
• モジュラー化の目的
• ステップ 1: SwiftUI to TCA
• ステップ 2: TCA モジュール化
• ステップ 3: Refactoring
• 結論
デモを実行しましょう
Declarative UI and SwiftUI
struct CounterView: View {
@State var count = 0
var body: some View {
HStack {
Button("-") { count -= 1 }
Text("(count)")
Button("+") { count += 1 }
}
}
}
Data Flow in SwiftUI
Declarative UI
UI = f( state )
The layout
on screen
Builder
methods
The application state
docs.
fl
utter.dev
Data Flow in SwiftUI
Data
fl
ow
Action View
State
👨💻
User Interaction Render
Update
Mutate
WWDC19: Data
fl
ow through SwiftUI
The Composable Architecture
TCA
• TCA は pointfree によって導入されます
• Unidirectional data
fl
ow architecture
• ex) elm, Redux, MVI, ReactorKit
Introduction
TCA
Architecture Diagram
Reducer
State
Action
View
Update
Mutate
Send Handle
Store
TCA
Architecture Diagram
"タップ"
Reducer
State
Action
View
Update
Send Handle
Store
Increment
Mutate
TCA
Architecture Diagram
Reducer
State
Action
View
Update
Mutate
Send Handle
Store
Increment
count=0
TCA
Architecture Diagram
Reducer
State
Action
View
Update
Send Handle
Store
count+=1
Mutate
TCA
Architecture Diagram
Reducer
State
Action
View
Update
Send Handle
Store
count+=1
Mutate
1
TCA
State Management
Reducer
State
Action
View
Update
Mutate
Send Handle
Store
TCA
State Management
Reducer
State
Action
View
Update
Mutate
Send Handle
Store
E
ff
ect Dependency
TCA
• Better State Management
• Easy to debug
• Enhance Testability
• Modularization(Composability)
Bene
fi
ts
Purpose of Modularization
Modularization
• The size of project grows,
the complexity increases exponentially
• Control this complexity is key of
Software Engineering
Purpose
Feature
Complexity
Time
Cost
• High Cohesion, Low Coupling
• Open to Extend, Close to modify
• Dependency Inversion
• Testability
Modularization
SOLID Principle
Modularization
• Composing Modules by Separating of Concerns
• Do Use Access Control(public, internal, private)
• Do access by protocol not by Implementation
• Use Dependencies by DI
• Write Unit Test
Principles for Robust Module
Modularization
• (Reducer + View) could be one component in TCA
• Composing Reducers to build a App
TCA
ステップ 1: SwiftUI to TCA
github.com/bbvch13531/githubsearch
Workshop1
• Change ViewModel to Reducer
• De
fi
ne State, Action
• Handling Action
• Implement GithubAPIClient
SwiftUI to TCA
ステップ 2: TCA モジュラー化
Workshop2
• Add Local Swift Package
• Create Modules according to Directories
• Add Access Control (public, internal, private)
• Inversion of Dependency
TCA Modularization
Workshop2
TCA Modularization
Core
RepoSearch
RepoDetail
Starring
Stargazer
App
Module Structure
ステップ 3: Refactoring
Workshop3
• Inject Dependency using DI Container
• Writing Unit Test
Refactoring
結 論
けつ ろん
Conclusion
• Migrate SwiftUI to TCA
• Seperate project into Modules
• Inject Dependency
• Writing Unit Test
What we've done
Conclusion
• How to compose module with high cohesion and low coupling
What we've learn
ありがとうございます。
KyuYoung Heo
@bbvch13531
iOS Developer

More Related Content

KEY
やはりお前らのMVCは間違っている
PPTX
プレゼン基礎講座 2016.11
PDF
WebSocket / WebRTCの技術紹介
PDF
ソーシャルゲームのためのデータベース設計
PDF
食べログのフロントエンドエンジニアってめっちゃ大変やねん・・・
PPTX
ITコミュニティと情報発信に共通する成長と貢献の要素
PDF
Riverpodでテストを書こう
PDF
ふつうの受託開発チームのつくりかた
やはりお前らのMVCは間違っている
プレゼン基礎講座 2016.11
WebSocket / WebRTCの技術紹介
ソーシャルゲームのためのデータベース設計
食べログのフロントエンドエンジニアってめっちゃ大変やねん・・・
ITコミュニティと情報発信に共通する成長と貢献の要素
Riverpodでテストを書こう
ふつうの受託開発チームのつくりかた

What's hot (20)

PDF
新入社員のための大規模ゲーム開発入門 サーバサイド編
PPTX
OpenVRやOpenXRの基本的なことを調べてみた
PDF
がんばらなくても C# で Single Page Web アプリケーションが書けてしまう「Blazor」とは
PDF
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
PDF
情報共有は、なぜGoogle Docsじゃなく、 Confluenceなのか。
PDF
はじめてのPRD
PPTX
【修正版】Django + SQLAlchemy: シンプルWay
PDF
「ユーザーを理解するって言うほどカンタンじゃないよね」 UXデザイン・UXリサーチをもう一度ちゃんと理解しよう!
PDF
怖くないSpring Bootのオートコンフィグレーション
ODP
MVC の Model を考える
PDF
よく聞くけど、「SharePoint リストの 5,000 件問題」ってなんなの?
PDF
Sphinxでまとめる多言語環境APIドキュメント
PDF
インタフェース完全に理解した
PDF
モデリングもしないでアジャイルとは何事だ
PDF
Unityではじめるオープンワールド制作 エンジニア編
PDF
イミュータブルデータモデル(入門編)
PDF
猫でも分かるUE4を使った VRコンテンツ開発 超入門編 2021
PPTX
プレゼン用 きれいでわかりやすいパワーポイントを作る方法
PDF
オブジェクト指向できていますか?
PDF
【プレゼン】見やすいプレゼン資料の作り方【初心者用】
新入社員のための大規模ゲーム開発入門 サーバサイド編
OpenVRやOpenXRの基本的なことを調べてみた
がんばらなくても C# で Single Page Web アプリケーションが書けてしまう「Blazor」とは
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
情報共有は、なぜGoogle Docsじゃなく、 Confluenceなのか。
はじめてのPRD
【修正版】Django + SQLAlchemy: シンプルWay
「ユーザーを理解するって言うほどカンタンじゃないよね」 UXデザイン・UXリサーチをもう一度ちゃんと理解しよう!
怖くないSpring Bootのオートコンフィグレーション
MVC の Model を考える
よく聞くけど、「SharePoint リストの 5,000 件問題」ってなんなの?
Sphinxでまとめる多言語環境APIドキュメント
インタフェース完全に理解した
モデリングもしないでアジャイルとは何事だ
Unityではじめるオープンワールド制作 エンジニア編
イミュータブルデータモデル(入門編)
猫でも分かるUE4を使った VRコンテンツ開発 超入門編 2021
プレゼン用 きれいでわかりやすいパワーポイントを作る方法
オブジェクト指向できていますか?
【プレゼン】見やすいプレゼン資料の作り方【初心者用】
Ad

Similar to スケーラブル SwiftUI プロジェクトにおける実用的な TCA モジュラー化 (20)

PDF
Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
PDF
Angular meetup 2 2019-08-29
PDF
Puppet Integration Adapter - Datasheet
PPTX
Knockout implementing mvvm in java script with knockout
PDF
Pragmatic Monolith-First, easy to decompose, clean architecture
PPTX
Building APIs with Mule and Spring Boot
PDF
DevOps-Ebook
PDF
CICD_BestPractices.pdf
PPTX
O365 Developer Bootcamp NJ 2018 - Material
PDF
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
PPTX
Azure DevOps Pipeline setup for Mule APIs #36
PDF
Spring Boot - Microservice Metrics Monitoring
PDF
Spring boot microservice metrics monitoring
PPTX
Evolution of netflix conductor
PDF
Bob Eisenmann and Justin Ranta: Automated Application Delivery on AWS using G...
PPTX
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
PPTX
Mobile App Architectures & Coding guidelines
PDF
Workshop: Delivering chnages for applications and databases
PDF
Continuous Integration and Continuous Deployment (CI/CD) with WSO2 Enterprise...
PPTX
RightScale Webinar: Best Practices: Software Development Strategies Using Win...
Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
Angular meetup 2 2019-08-29
Puppet Integration Adapter - Datasheet
Knockout implementing mvvm in java script with knockout
Pragmatic Monolith-First, easy to decompose, clean architecture
Building APIs with Mule and Spring Boot
DevOps-Ebook
CICD_BestPractices.pdf
O365 Developer Bootcamp NJ 2018 - Material
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
Azure DevOps Pipeline setup for Mule APIs #36
Spring Boot - Microservice Metrics Monitoring
Spring boot microservice metrics monitoring
Evolution of netflix conductor
Bob Eisenmann and Justin Ranta: Automated Application Delivery on AWS using G...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
Mobile App Architectures & Coding guidelines
Workshop: Delivering chnages for applications and databases
Continuous Integration and Continuous Deployment (CI/CD) with WSO2 Enterprise...
RightScale Webinar: Best Practices: Software Development Strategies Using Win...
Ad

More from 규영 허 (6)

PDF
LLVM UB Optimization
PDF
프로그래머의 뇌
PDF
SwiftUI와 TCA로 GitHub Search앱 만들기
PDF
Swift for tensorflow
PDF
Influencer
PPTX
Chromium에 contribution하기
LLVM UB Optimization
프로그래머의 뇌
SwiftUI와 TCA로 GitHub Search앱 만들기
Swift for tensorflow
Influencer
Chromium에 contribution하기

Recently uploaded (20)

PPTX
Amdahl’s law is explained in the above power point presentations
PDF
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
PDF
ChapteR012372321DFGDSFGDFGDFSGDFGDFGDFGSDFGDFGFD
PPT
Total quality management ppt for engineering students
PPTX
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
PPTX
Software Engineering and software moduleing
PPTX
communication and presentation skills 01
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PPTX
Information Storage and Retrieval Techniques Unit III
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PDF
Visual Aids for Exploratory Data Analysis.pdf
PPTX
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PDF
August -2025_Top10 Read_Articles_ijait.pdf
PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PPTX
CyberSecurity Mobile and Wireless Devices
Amdahl’s law is explained in the above power point presentations
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
ChapteR012372321DFGDSFGDFGDFSGDFGDFGDFGSDFGDFGFD
Total quality management ppt for engineering students
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
Software Engineering and software moduleing
communication and presentation skills 01
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
Information Storage and Retrieval Techniques Unit III
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Fundamentals of safety and accident prevention -final (1).pptx
Visual Aids for Exploratory Data Analysis.pdf
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
August -2025_Top10 Read_Articles_ijait.pdf
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
III.4.1.2_The_Space_Environment.p pdffdf
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
distributed database system" (DDBS) is often used to refer to both the distri...
CyberSecurity Mobile and Wireless Devices

スケーラブル SwiftUI プロジェクトにおける実用的な TCA モジュラー化