public protocol CDViewModel: class {
var cancellableList: [AnyCancellable] { get set }
}
public extension CDViewModel {
func subscribe(_ callback: @escaping (Project) -> Void) {
cancellableList.append( /*...*/)
}
}
I have a protocol that will be used outside of the module. So I have to declare it public.
But I want the class conforming to that to implement cancellableList with private access.
class MyClass: CDViewModel {
private var cancellableList: [AnyCancellable] = [AnyCancellable]()
}
Property 'cancellableList' must be declared public because it matches a requirement in public protocol 'CDViewModel'
Is this possible?