Post

Replies

Boosts

Views

Activity

NameSpace inside ViewModel
I know that the namespace property should not be inside the ViewModel because the identifiers are not going to match, but in this case, they actually do.Everything works fine and I just don't want to pass the namespace through all the views. Do you guys think there is a way to get rid of the annoying purple warning "Reading a Namespace property outside View.body. This will result in identifiers that never match any other identifier."? class MyViewModel: ObservableObject { var namespace: Namespace.ID static let shared: MyViewModel = .init() private init() { @Namespace var namespace self.namespace = namespace } }
0
0
622
Jul ’23