9

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?

Leena
  • 2,678
  • 1
  • 30
  • 43
SwiftedMind
  • 3,701
  • 3
  • 29
  • 63

2 Answers2

13

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)

Community
  • 1
  • 1
Martin R
  • 529,903
  • 94
  • 1,240
  • 1,382
1

Available in Xcode 11 beta 2, but have to import Combine