SwiftData @Environment can't use bindings?

I may not be understanding this right, but when trying to use the new @Environment for what was previously @EnvironmentObject I am unable to use a NavigationPath in a NavigationStack:

@Observable
class AppData {
    var presented: NavigationPath = NavigationPath()
}
NavigationStack(path: appData.$presented) {...

Value of type 'AppData' has no member '$presented'

Cannot convert value of type 'NavigationPath' to expected argument type 'Binding<NavigationPath>'

Moving the $ to the front or removing it does nothing either.

I think this requires adding @Bindable to the appData declaration.

@Bindable var appData:AppData

This is from WWDC23 "Discover Observation in Swift" 6:27

Same problem here. I'm struggling with extracting NavigationPath() into a separate class using @Observable.

When this class is marked as @Observable, typing NavigationStack(path: viewModel.path) {...} results in error:

Cannot convert value of type 'NavigationPath' to expected argument type 'Binding<NavigationPath>'

Variations like $viewModel.path or viewModel.$path do not work either.

The only "working" solution is:

var body: some View {
  @Bindable var bindable = viewModel
  NavigationStack(path: $bindable.path) {...}
}

But this is very hacky.

SwiftData @Environment can't use bindings?
 
 
Q