Post

Replies

Boosts

Views

Created

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
1
937
Jul ’23
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 } }
Replies
0
Boosts
1
Views
937
Activity
Jul ’23
Can't change time in Xcode Simulator
Does anyone have the same problem? Tried on several devices, didn't help. Changing battery state does not work as well. I guess there should be another way to modify status bar on iOS 16. It worked on iOS 15 though. xcrun simctl status_bar "iPhone 14 Plus" override --time "9:41"
Replies
13
Boosts
16
Views
12k
Activity
Nov ’22