Wednesday, February 1, 2017 [Tweets] [Favorites]

Swift Classes That Conform to Protocols

Chris Eidhof:

The other day, someone asked how to have a variable which stores a UIView that also conforms to a protocol. In Objective-C, you would simply write UIView<HeaderViewProtocol>. In current Swift, you can’t write something like that. This posts shows a two workarounds.

Comments

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

Leave a Comment