I'm inspecting Combine, a new framework by Apple. I created a playground, ran it in macOS Mojave 10.14.5 and Xcode 11.0 beta (11M336w).
Here is my code:
import Combine
struct Article: Identifiable {
var id: Int
var title: String
}
final class Data: BindableObject {
let didChange = PassthroughSubject<Data, Never>()
var showFavouriteOnly = false {
didSet {
didChange.send(self)
}
}
var articles: [Article] = [.init(id: 1, title: "WWDC 2018"),
.init(id: 2, title: "WWDC 2019")] {
didSet {
didChange.send(self)
}
}
}
But it fails with log:
error: Couldn't lookup symbols: Combine.PassthroughSubject.send(A) -> ()
What am I doing wrong?