Post marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
contentPostList.repliessolved.tooltip
Replied In
No ObservableObject
Add the .environmentObject(UserData()) at the @main point in WindowGroup in the View
For eg:
@main
struct YourApp: App {
@StateObject var userData = UserData()
var body: some Scene {
WindowGroup
{
YourMainView().environmentObject(userdata)
}
}
}
Also Try replacing the if !self.userData.showFavoritesOnly with
if userData.showFavouritesOnly != false or true // According to your condition