Questions tagged [swift-composable-architecture]

For questions about PointFree's Swift Composable Architecture.

The Composable Architecture (TCA, for short) is a library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind. It can be used in SwiftUI, UIKit, and more, and on any Apple platform (iOS, macOS, tvOS, and watchOS).

20 questions
4
votes
0 answers

`UIViewControllerRepresentable` table view disappears after long tap

I have a UIViewControllerRepresentable wrapper for UITableViewController and am using swift composable architecture, which is probably irrelevant to the issue. Here's my table view wrapper code, including the context menu code (I have omitted quite…
smeshko
  • 1,184
  • 13
  • 27
3
votes
1 answer

SwiftUI Composable Architecture Not Updating Views

I am using The Composable Architecture for a SwiftUI app, and I am facing issues with the view not updating when my store's state changes. My screen flow is as follows: RootView -> RecipeListView -> RecipeDetailView --> RecipeFormView (presented as…
3
votes
1 answer

Dismissed view empties before animation starts when using SwiftUI navigation in combination with TCA

We are struggling with SwiftUI navigation in combination with TCA and I am wondering is someone else did encounter similar issue. The problem is that when we set parameters isPresented or isActive on .sheet or NavigationLink to false to dismiss it,…
2
votes
2 answers

TCA - send an event from one reducer to another/modify the state of a different store

I'm new to TCA (The Composable Architecture) so I may have the entirely wrong approach here, so apologies if so I and I would appreciate getting pointed in the right direction. It's a little bit tricky to find resources for this since I've adopted…
Matt Beaney
  • 460
  • 4
  • 15
2
votes
0 answers

shared state for The (Swift) Composable Architecture with the new ReducerProtocol

The TCA guys provide a [Case Study] (https://github.com/pointfreeco/swift-composable-architecture/blob/main/Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-SharedState.swift) for shared state using the ReducerProtocol. I read the case…
Small Talk
  • 747
  • 1
  • 6
  • 15
2
votes
1 answer

How to think about model/state structure when using ComposableArchitecture?

I'm trying to create a basic time tracking app using SwiftUI and the ComposableArchitecture. But I'm struggling with how I should think about modeling the data structure/app state in a modular way. The app is a time tracking app, so it has: a…
eivindml
  • 2,197
  • 7
  • 36
  • 68
1
vote
1 answer

Is 'fireAndForget' still a thing in Composable Architecture

With the release of Composable Architecture 1.0, what is the recommended way to fire off arbitrary code from a Reducer? In the old days this was handled with return Effect.fireAndForget{//code here} I know TCA is moving away from Apple's Combine…
Small Talk
  • 747
  • 1
  • 6
  • 15
1
vote
0 answers

How to cancel an action inside another action in ComposableArchitecture

I am learning TCA using this link, I am having an issue which is when I tap the fact button, I need to stop the timer and trigger the toggleTimerButtonTapped action. I tried to add .cancellable to .factButtonTapepd action but it doesn't work. I just…
Mc.Lover
  • 4,813
  • 9
  • 46
  • 80
1
vote
0 answers

TCA: Using a reference-type property within a State struct fails to drive UI updates

Below is simplified State for a TCA App. (Assume the rest of the stack is compiling.) //PROBLEM: When Dog is a Class, instead of a Struct, changes to the dog name property made in the Reducer fail to update the UI class Dog: Equatable { var…
Small Talk
  • 747
  • 1
  • 6
  • 15
1
vote
1 answer

Why am I getting some @Environment updates but not others?

The app I'm working on is SwiftUI (with TCA) and there is a requirement to send some Display Characteristics in our analytics. Assumption: @Environment values are all updated in the same way, therefore the following code should get the same…
1
vote
1 answer

How to know which List item is tapped using Composable Architecture with SwiftUI?

Given a pretty basic TCA View with a List populated by a ViewStore, how to know which cell in the list is tapped? in onTapGesture, there is no access to the item, since its a scope above. If you add a onTapGesture to the Text, it will not trigger…
bogen
  • 9,954
  • 9
  • 50
  • 89
1
vote
1 answer

why is xcode console output sluggish after app launch in simulator?

During a marathon session yesterday (from 7 am until past midnight), I suddenly ran into an issue where, immediately after launching the app in the simulator, button taps with prints to the console and swipes on views wouldn't result in any change…
Mozahler
  • 4,958
  • 6
  • 36
  • 56
0
votes
1 answer

Using NavigationSplitView with The Composable Architecture

I'm trying to learn navigation using TCA, and want to create a macOS app with a sidebar. This is what I want to achieve: Except with the text replaced with ProjectView() with the corresponding Blob Jr project. NavigationView is deprecated and Apple…
eivindml
  • 2,197
  • 7
  • 36
  • 68
0
votes
1 answer

How to implement a working confirmationDialog in The (Swift) Composable Architecture 1.0

In pre 1.0 TCA, there was relatively straightforward was to present a ConfirmationDialog scope the Store in a View modifier to the State property holding an optional ConfirmationDialogState struct. provide a dismiss action When the optional was…
Small Talk
  • 747
  • 1
  • 6
  • 15
0
votes
0 answers

Pass a binding variable from one state to another in swiftui

I am new to SwiftUI and TCA (the composable architecture) and I am having troubles passing a binding var in one state from one view to another. Here's what I'm doing: In PlaceView I have the following state: struct PlaceStore: ReducerProtocol { …
Joan Cardona
  • 3,463
  • 2
  • 25
  • 43
1
2