본문 바로가기

Swift/TCA16

[TCA] 왜 Dependency 라이브러리를 사용해야하나요? 그냥 init에 의존성 전달하면 되는데...(커뮤니티 질문) Beginner question: why would I use this vs passing dependencies in initializers?https://github.com/pointfreeco/swift-dependencies/discussions/228 Beginner question: why would I use this vs passing dependencies in initializers? · pointfreeco swift-dependencies · DiscussionHello there, this is a question from a beginner, but I'm not sure why I would want to use this - and have my code needing to u.. 2024. 11. 9.
[TCA] Performance 읽어보기 ArticlePerformanceLearn how to improve the performance of features built in the Composable Architecture. Overview As your features and application grow you may run into performance problems, such as reducers becoming slow to execute, SwiftUI view bodies executing more often than expected, and more. This article outlines a few common pitfalls when developing features in the library, and how to fi.. 2024. 8. 29.
[TCA] Effect.swift 공식문서 음미하기 1. TCA에서 호출하는 Reducer Action은 모두 Main Thread니까 Thread Safe? (아님)TCA에서 호출하는 Reducer Action은 모두 MainThread에서 실행됩니다.  이유는 Send에 나와있습니다. 우리가 Reducer의 Action을 호출하는 경우는 두 가지 입니다.  - view에 저장된 Store의 send 매서드를 통해 을 통해 호출 (만약 MainThraead가 아닌 다른 곳에서 호출할 시 런타임 에러 발생) - reducer 내부에서 send를 통해 호출  Store에 저장된 send와, reducer의 send의 경우 다음과 같은 코드를 볼 수 있습니다. @MainActor 때문에 send Struct을 Effect.run에서 호출 할 때 마다 Main.. 2024. 8. 24.
[TCA] day 13 타이머 (Effects- Timer) 코드 전문import ComposableArchitectureimport SwiftUIprivate let readMe = """ This application demonstrates how to work with timers in the Composable Architecture. It makes use of the `.timer` method on clocks, which is a helper provided by the Swift Clocks \ library included with this library. The helper provides an `AsyncSequence`-friendly API for \ dealing with times in asynchronous code. """.. 2024. 5. 8.
[TCA] day 12 새로고침 (Effects-Refreshable) 코드 전문import ComposableArchitectureimport SwiftUIprivate let readMe = """ This application demonstrates how to make use of SwiftUI's `refreshable` API in the Composable \ Architecture. Use the "-" and "+" buttons to count up and down, and then pull down to request \ a fact about that number. There is a discardable task that is returned from the store's `.send` method representing any \ effec.. 2024. 5. 7.
[TCA] day 10 long living Effect (publisher Effect and async/await effect) 코드 전문import ComposableArchitectureimport SwiftUIimport Combineprivate let readMe = """ This application demonstrates how to handle long-living effects, for example notifications from \ Notification Center, and how to tie an effect's lifetime to the lifetime of the view. Run this application in the simulator, and take a few screenshots by going to \ *Device › Screenshot* in the menu, and obse.. 2024. 5. 5.