Since updating to XCode 16, the following error is thrown in the Defaults package: "Accessing StateObject's object without being installed on a View. This will create a new instance each time."
I'm using the package in one view only:
public let extensionDefaults = UserDefaults(suiteName: "...")!
extension Defaults.Keys {
public static let isBypass = Key<Bool>("isBypass", default: false, suite: extensionDefaults)
public static let deviceID = Key<String>("deviceID", default: noneDeviceID, suite: extensionDefaults)
}
struct TabSettingsView: View {
...
@Default(.deviceID) var deviceID: String
@Default(.isBypass) var isBypass: Bool
...
}
Am I using it wrong? Before, in XCode 15, this error did not show up. And I'm using the latest main branch commit.
Since updating to XCode 16, the following error is thrown in the Defaults package: "Accessing StateObject's object without being installed on a View. This will create a new instance each time."
I'm using the package in one view only:
Am I using it wrong? Before, in XCode 15, this error did not show up. And I'm using the latest main branch commit.