Wednesday, February 1, 2017

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

Leave a Comment