Reduce // Reduce initializer @inlinable public init(_ reduce: @escaping (_ state: inout State, _ action: Action) -> Effect) { self.init(internal: reduce) } Reduce๋ Effect์ ๋ฐํํ๋ ํด๋ก์ ธ๋ฅผ ๊ฐ์ง๊ณ ์์ Effect์ ์ฌ์ฉํด์ ์ํ๋ฅผ ๊ด๋ฆฌ Reducer ๋ด๋ถ์์ State๋ฅผ ๋ณํํ๊ณ ๊ด๋ฆฌ Effect๋ฅผ Application์ ํผ๋๋ฐฑ (Side Effect) -> Reducer ๋ด๋ถ์์ Reduce๋ฅผ ๊ฐ์ง๊ณ ์ํ๋ฅผ ๊ด๋ฆฌํ๋ค. ์ด๋ effect๋ฅผ ์ผ์ผ์ผ ํผ๋๋ฐฑ์ ํ ์ ์๋๋ฐ ์ด๋ฅผ side effect๋ผ๊ณ ํ๋ค. .run Reduce๋ Effect์ ๋ฐํํด์ผ ํ๋ค public..
TCA๋ฅผ ๊ณต๋ถํ๋ค ๋ณด๋ SwiftUI ๋ฟ๋ง ์๋๋ผ UIKit์์๋ ์ฌ์ฉํ ์ ์๋ Dependency๋ฅผ ์ ๊ณตํ๊ธธ๋ ๋ฐ๋ก ๊ธ์ ์ ์ด์ผ ๊ฒ ๋๋ผ๊ตฌ์! ์์กด์ฑ์ ๊ด๋ฆฌํ๊ธฐ ์ํ Swinject, Niddle, Factory ๋ฑ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์๋๋ฐ TCA์ Depdency๋ ํ๋ฅญํ๊ณ ์ฌ์ฉํ๊ธฐ ํธ๋ฆฌํ ์์กด์ฑ ๊ด๋ฆฌ๋ฅผ ์ ๊ณตํฉ๋๋ค. ๊ณต์ ๋ฌธ์์ ๊ณต์ ๋ฒ์ญ์ ์๋ ์ฌ์ดํธ์์ ํ์ธํ ์ ์์ด์ Chapter 5. Dependency | Built with Notion 5.1 TCA์ Dependency axiomatic-fuschia-666.notion.site ๊ณต์ ๋ฌธ์๋ฅผ ๋ณด์๋ ค๋ฉด ์ด ์ฌ์ดํธ๋ก ์ด๋ํ์๋ฉด ๋ฉ๋๋ค. Documentation pointfreeco.github.io TCA์์๋ DI(Dependency Inje..
SwiftUI TCA ์ฅ์ - State ์ ๋ณ๊ฒฝ -> UI์ ์ฆ์ ๋ฐ์ - ์ฝ๋ ์์ฑ์ด ๊ฐ๋จํจ - State ๋ณ๊ฒฝ ๋ก์ง ๊ด๋ฆฌ ์ฉ์ด - ๋ณต์กํ State์ ์ด์ ๋ฐ๋ฅธ Side Effect ์ฒ๋ฆฌ ์ฉ์ด ๋จ์ - State ๊ด๋ฆฌ๊ฐ ๋ณต์กํด ์ง์๋ก State ๋ณํ์ ๋ฐ๋ฅธ side effect๋ฅผ ๊ด๋ฆฌํ๊ธฐ ์ด๋ ค์ - ์ด๋ ค์ด ๊ตฌํ ๋์ด๋ ๐ฅ ๐ซ TCA Binding public func binding( get: @escaping (_ state: ViewState) -> Value, send valueToAction: @escaping (_ value: Value) -> ViewAction ) -> Binding { ObservedObject(wrappedValue: self) .projectedValue[get: ...
Scope๋? ์ด์ ํํ ๋ฐฉ์ struct Scope where Child : ReducerProtocol ํ์ฌ ํํ ๋ฐฉ์ struct Scope: Reducer parent domain์ child domain์ผ๋ก ๋ณ๊ฒฝ -> ํ์ ๋๋ฉ์ธ์์ child reduce๋ฅผ ์คํ ์ํด ํฐ ๊ท๋ชจ์ feature์ ์์ ๋จ์๋ก ์ชผ๊ฐ๊ฑฐ๋ ํฉ์น ์ ์์ ์์ ๋จ์์ feature๋ ํฐ ๊ท๋ชจ์ feature ๋ณด๋ค ์ดํดํ๊ธฐ ์ฌ์ฐ๋ฉฐ test ๋ฐ ๋ชจ๋ํ๋ ๋ฐฉ์์ผ๋ก ๊ด๋ฆฌํ ์ ์์ Scope ์์ฑ @inlinable public init( state toChildState: WritableKeyPath, action toChildAction: AnyCasePath, @ReducerBuilder child: () -> Child..
์ถ์ฒ ๋ฐ ์ฐธ๊ณ ์ฌ์ดํธ https://axiomatic-fuschia-666.notion.site/Chapter-3-TCA-2-c56b24efb2154dad9ed8e54139247024 Chapter 3. TCA์ ๊ธฐ๋ณธ๊ฐ๋
(2) ์์ ์ฅ์์ ์ฐ๋ฆฌ๋ ์ฑ์ ์ํ๋ฅผ ๋ํ๋ด๋ State์ ์ด๋ฅผ ๋ณ๊ฒฝํ ์๋จ์ธ Action, ๊ทธ Action์ ๊ธฐ๋ฅ์ ๊ตฌํํ๊ณ ์ํ์ ๋ณ๊ฒฝ์ ์ฒ๋ฆฌํ๋ Reducer์ ์์๋ณด๋ฉฐ, TCA์์์ ๋ฐ์ดํฐํ๋ฆ์ ๋ํด์ ์ดํด๋ณด์์ต๋ axiomatic-fuschia-666.notion.site What is Store ๋ฐ ํ์๋์ Reducer์ ์ธ์คํด์ค๋ฅผ ๊ด๋ฆฌํ๋ ์ฐธ์กฐ ํ์
๊ฐ์ฒด ์ฑ์ State, Action์ ๊ด๋ฆฌ State์ ๋ณํ ๊ฐ์ง ์ก์
์ฒ๋ฆฌ let store: Store public ty..
์ถ์ฒ ๋ฐ ์ฐธ๊ณ ์ฌ์ดํธ https://axiomatic-fuschia-666.notion.site/Chapter-3-TCA-2-c56b24efb2154dad9ed8e54139247024 Chapter 3. TCA์ ๊ธฐ๋ณธ๊ฐ๋
(2) ์์ ์ฅ์์ ์ฐ๋ฆฌ๋ ์ฑ์ ์ํ๋ฅผ ๋ํ๋ด๋ State์ ์ด๋ฅผ ๋ณ๊ฒฝํ ์๋จ์ธ Action, ๊ทธ Action์ ๊ธฐ๋ฅ์ ๊ตฌํํ๊ณ ์ํ์ ๋ณ๊ฒฝ์ ์ฒ๋ฆฌํ๋ Reducer์ ์์๋ณด๋ฉฐ, TCA์์์ ๋ฐ์ดํฐํ๋ฆ์ ๋ํด์ ์ดํด๋ณด์์ต๋ axiomatic-fuschia-666.notion.site Effect๋? Action์ด ๋ฐํํ๋ ํ์
์ ๋ปํ๋ฉฐ Action์ ๊ฑฐ์น ๋ชจ๋ ๊ฒฐ๊ณผ๋ฌผ์ ์๋ฏธํ๋ค. ๋น๋๊ธฐ ์์
์ด๋ ์ธ๋ถ ์์ฉ์ ์ํด ๋ฐ์ํ๋ Side Effect๋ ์ด๋ค ์ฒ๋ฆฌ ์ดํ ์์์น ๋ชปํ๊ฒ ์ป์ ๊ฒฐ๊ณผ๋ฌผ์..
TCA๋ฅผ ๊ณต๋ถํ๋ค๊ฐ Timer ์์๋ก ๋ฌด์์ ๊ตฌํํ๋ฉด ์ข์๊น ์๊ฐํด ๋ดค๋๋ ์ผํ๋ชฐ ์ฑ์ด ๋ ์ค๋ฅด๋๋ผ๊ตฌ์! ์ค๋ ์์ ๊น์ง์ ๋จ์ ์๊ฐ์ ๊ณ์ฐํด์ ์ค๋์ด ์ง๋๋ฉด ๊ตฌ๋งคํ ์ ์๋๋ก ๋ฒํผ์ ๋นํ์ฑํ ์ํฌ๊ฑฐ์์. ํ์ด๋จธ๋ฅผ ํ์ํ๋ ์ ๋ถ๋ถ์ด ๊ตฌ๋งค ๋ฒํผ์
๋๋ค. ๊ตฌํํด ๋๊ณ ๋ณด๋ ํ์ด๋จธ UI์ ๊ตฌ๋งคํ๊ธฐ ๋ฒํผ์ ๋ณ๋๋ก ๋ถ๋ฆฌํ ๊ฑธ ๊ทธ๋ฌ์ด์ ๐ฅฒ State struct State: Equatable { var isTimerOn = false var leftTime = "00:00:00" var isBuyButtonDisabled = true } isTimerOn์ด true๊ฐ ๋๋ฉด ํ์ด๋จธ๋ฅผ ์์ํ๊ณ false๊ฐ ๋๋ฉด ํ์ด๋จธ๋ฅผ cancel ์์ผ์ค๋๋ค. leftTime์ ๋ฒํผ ์์ญ์ ์๊ฐ ๋ถ๋ถ์ ํ์๋ ์คํธ๋ง ๊ฐ์ด์์. isBuy..
์ฐธ๊ณ ์ฌ์ดํธ https://axiomatic-fuschia-666.notion.site/Chapter-1-Hello-TCA-70c56437681547d4b85cd1363a157356 Chapter 1. Hello, TCA ์๋
ํ์ธ์. Swift๋ก Apple ์ํ๊ณ ๊ฐ๋ฐ์ ์ผ์กฐํด ์ฃผ์๋ ๊ฐ๋ฐ์ ์ฌ๋ฌ๋ถ, ๋ชจ๋ ๋ฐ๊ฐ์ต๋๋ค! axiomatic-fuschia-666.notion.site https://www.pointfree.co/collections/tours/composable-architecture-1-0/ep243-tour-of-the-composable-architecture-1-0-the-basics Episode #243: Tour of the Composable Architecture: The Ba..
'iOS ๐/Architecture' ์นดํ
๊ณ ๋ฆฌ์ ๊ธ ๋ชฉ๋ก
๋จ์ถํค
๋ด ๋ธ๋ก๊ทธ
๋ด ๋ธ๋ก๊ทธ - ๊ด๋ฆฌ์ ํ ์ ํ |
Q
Q
|
์ ๊ธ ์ฐ๊ธฐ |
W
W
|
๋ธ๋ก๊ทธ ๊ฒ์๊ธ
๊ธ ์์ (๊ถํ ์๋ ๊ฒฝ์ฐ) |
E
E
|
๋๊ธ ์์ญ์ผ๋ก ์ด๋ |
C
C
|
๋ชจ๋ ์์ญ
์ด ํ์ด์ง์ URL ๋ณต์ฌ |
S
S
|
๋งจ ์๋ก ์ด๋ |
T
T
|
ํฐ์คํ ๋ฆฌ ํ ์ด๋ |
H
H
|
๋จ์ถํค ์๋ด |
Shift + /
โง + /
|
* ๋จ์ถํค๋ ํ๊ธ/์๋ฌธ ๋์๋ฌธ์๋ก ์ด์ฉ ๊ฐ๋ฅํ๋ฉฐ, ํฐ์คํ ๋ฆฌ ๊ธฐ๋ณธ ๋๋ฉ์ธ์์๋ง ๋์ํฉ๋๋ค.