I am getting the same message when setting up UserDefaults with combine. The code is simple enough var twitterOauthTokenSecret: String {
willSet{
objectWillChange.send(self)
}
}
init() {
notificationSubscription = NotificationCenter.default.publisher(for: UserDefaults.didChangeNotification).sink { _ in
self.objectWillChange.send(self)
}
}
Not sure I understand the recommended solution above by @gandhi_ms. Can you clarify how I would use this in a this case?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: