[swift-evolution] Property with class and protocol type

Adrian Śliwa adiki69 at gmail.com
Tue Jun 14 11:59:36 CDT 2016


Hi all,

In Obj-C we have:

@property UIViewController<Protocol1, Protocol2, ...> *viewController;

Is there any reason we don't have in Swift:

var viewController: UViewController<Protocol1, Protocol2, ...>

Do you think it will be nice feature to have in Swift?
One example I have is is to have VC's container with view controllers(some
forms) which implement Validable protocol to enforce them to have
implementation of this method and to prevent situation that there is
somewhere default implementation of the method "isValid" e.g. in superclass
or protocol extension.
What are your thoughts?

Cheers,
Adrian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160614/bbcaec6d/attachment.html>


More information about the swift-evolution mailing list