You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey I think I found a big issue about the whole concept of using the flow as an environmentObject. when you pass the flow as @EnvironmentObject private var object: FlowProvider the swiftUI holds it in the whole app and none of the view models of any nested screens would get destroyed after the related screen get poped and also for the screens that you hold in the NavigationController stack.
For Example If I start from the home screen and go to the details screen, the view model of the home screen remains alive and also after I pop from the details screen back to the home screen the view model of the details screens remains alive.
public var body: some View {
flow.present()
.environmentObject(flow)
}
FlowKit no longer injects FlowProvider as a SwiftUI EnvironmentObject. @Flow now reads a weak custom environment value, and FlowPresenter plus pushed hosting controllers apply that value automatically, avoiding the provider-retains-navigation-stack-retains-environment cycle.
Activity
mercen-lee commentedon Jun 22, 2026
Resolved in 86cdb21 on main.
FlowKit no longer injects
FlowProvideras a SwiftUIEnvironmentObject.@Flownow reads a weak custom environment value, andFlowPresenterplus pushed hosting controllers apply that value automatically, avoiding the provider-retains-navigation-stack-retains-environment cycle.Validation:
xcodebuild -scheme FlowKit -destination "generic/platform=iOS Simulator" -sdk iphonesimulator buildsucceeded.