Hello I have a problem with Swift Protocol
I have declared a protocol named BaseViewModel
I have class called AViewModel and BViewModel which conform to protocol BaseViewModel
class AViewModel : NSObject , BaseViewModel
class BViewModel : NSObject , BaseViewModel
Now , I need to declare a completion block that returning those Object which conform to protocol BaseViewModel
typealias ViewModelCompletionBlock = (_ value : BaseViewModel) -> Void
In objective-C I used to declare something like this
id<BaseViewModel>
In Swift, how to declare the same ??
typealias ViewModelCompletionBlock = (_ value : BaseViewModel) -> Void
? That already looks correct. – Martin R