Thursday, June 23, 2016 [Tweets] [Favorites]

Swift Protocols Constrained to a Specific Class

BJ Homer:

Objective-C developers learning Swift often wonder how to represent something like UIViewController<MyProtocol>. The simple answer is that there's currently no way to directly represent that construct in Swift as of Swift 2.2. However, it's possible to work around it fairly easily with just a tiny bit of extra code.

Comments

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment