Are there any docs on SKIE Flows in SwiftUI feature that show what is the recommended way to trigger the equivalent of a Compose side effect?
dorche
11/13/2025, 8:50 AM
For the example in the docs on the website:
Copy code
struct ExampleView: View {
let viewModel = SharedViewModel()
var body: some View {
// Observing multiple flows with attached initial values, only requiring a single view closure for content.
Observing(viewModel.counter.withInitialValue(0), viewModel.toggle) { counter, toggle in
Text("Counter: \(counter), Toggle: \(toggle)")
}
}
}
What is the recommended way to trigger a function (i.e. navigation) when the counter reaches
100
for example ?
f
Filip Wiesner
11/13/2025, 8:53 AM
That looks more like a SwiftUI question. I think you could use the
.task(id) {}
modifier in SwiftUI which starts a task when the id changes. It's very similar to