It would be really great if you could specify that a generic type might conform to a type.
Eg:
protocol LogOutDelegate {
func logOutPressed()
}
class AccountView<T: DetailsDelegate? & LogOutDelegate?> {
var delegate: T
func logOut() {
delegate.logOutPressed?()
}
}
(That was types directly in so forgive any errors)
At the moment I have different delegate variables (eg logOutDelegate
detailsDelegate
and it would be great to combine them into one.