본문 바로가기

Swift/TCA16

[TCA] day 10 Effect 취소 (TCA @Shared, Sheet) 코드 전문import ComposableArchitectureimport SwiftUIprivate let readMe = """ This screen demonstrates how one can cancel in-flight effects in the Composable Architecture. Use the stepper to count to a number, and then tap the "Number fact" button to fetch \ a random fact about that number using an API. While the API request is in-flight, you can tap "Cancel" to cancel the effect and prevent \ i.. 2024. 5. 3.
[TCA] TCA 1.10 이후부터의 Shared State의 initRule https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/sharingstate/#Initialization-rules Documentation pointfreeco.github.ioInitalization Rules- Shared타입으로 선언하기 위해서 특별한 Intialize 규칙이 존재- 이 룰은 어떠한 종류의 프로퍼티 래퍼에도 해당됩니다. (vanilSwiftUI에 해당하는 @state, @stateObject 등등)  - non-persited state일 경우 (@shared) sourth of trouth는 부모뷰에 존재한다. - initalzier는 Shared va.. 2024. 5. 2.
[TCA] day 9 Shared State활용한 TodosList 예제 (TCA @Shared, Sheet) 작성개요TCA 1.10부터 SharedState을 관리하는 방식이 달라졌습니다. 이전에 SharedState를 관리하기 위해서 onchange매서드를 통해관리했는데, 이제는 @Shared라는 Macro로 관리하는 방법으로 달라졌습니다. 그래서 이를 공부하고자 글을 작성하게 되었습니다.   코드https://github.com/MaraMincho/MakingFrogWithoutDissecting/tree/main/TIL_TodosWithTCAShared/TIL_TodosWithTCAShared MakingFrogWithoutDissecting/TIL_TodosWithTCAShared/TIL_TodosWithTCAShared at main · MaraMincho/MakingFrogWithoutDissecti.. 2024. 5. 1.
[TCA] day 8 TCA 1.10 이후부터의 Shared State 관리(@Shared) 코드 전문import ComposableArchitectureimport SwiftUIprivate let readMe = """ This case study demonstrates how to use shared data in order to implement a complex sign up flow. The sign up flow consists of 3 steps, each of which can mutate a bit of shared data, and a final \ summary screen. The summary screen also allows the user to make any last minute edits to any of \ the data in the previous s.. 2024. 4. 30.
[TCA] day 7 TCA의 Dependency에 대해서 (Effects-Basics) 코드 전문import ComposableArchitectureimport SwiftUIprivate let readMe = """ This screen demonstrates how to introduce side effects into a feature built with the \ Composable Architecture. A side effect is a unit of work that needs to be performed in the outside world. For example, an \ API request needs to reach an external service over HTTP, which brings with it lots of \ uncertainty and comp.. 2024. 4. 29.
[TCA] day 5 Optional State를 활용하여 View조작하기(GettingStarted-OptionalState) 코드 전문import ComposableArchitectureimport SwiftUIprivate let readMe = """ This screen demonstrates how to show and hide views based on the presence of some optional child \ state. The parent state holds a `Counter.State?` value. When it is `nil` we will default to a plain \ text view. But when it is non-`nil` we will show a view fragment for a counter that operates on \ the non-optional coun.. 2024. 4. 26.