I watched the WWDC 2019 session "Combine in Practice" (https://developer.apple.com/videos/play/wwdc2019/721/).
In the video they used the following syntax to create a publisher:
@Published var someName: String = ""
They did this so that someName
becomes a publisher. However, Xcode doesn't like this syntax and gives me an error:
Unknown attribute 'Published
I have no idea why. I'm using the Xcode 11 beta on macOS Catalina.
Any ideas?
From the Xcode 11 Beta Release Notes (emphasis added):
The Foundation integration for the Combine framework is unavailable. The following Foundation and Grand Central Dispatch integrations with Combine are unavailable: KeyValueObserving, NotificationCenter, RunLoop, OperationQueue, Timer, URLSession, DispatchQueue, JSONEncoder, JSONDecoder, PropertyListEncoder, PropertyListDecoder, and the @Published property wrapper. (51241500)
Update: This has been fixed with Xcode 11 beta 2. From the Xcode 11 Beta 2 Release Notes:
Resolved Issues
The Foundation integration for the Combine framework is now available. The following Foundation and Grand Central Dispatch integrations with Combine are available: KeyValueObserving, NotificationCenter, RunLoop, OperationQueue, Timer, URLSession, DispatchQueue, JSONEncoder, JSONDecoder, PropertyListEncoder, PropertyListDecoder, and the @Published property wrapper. (51241500)
Available in Xcode 11 beta 2, but have to import Combine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With