Thursday, June 23, 2016

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 RSS · Twitter

Leave a Comment