Avatar
@swift-4.2.4 import UIKit protocol Component: UIView { associatedtype Model func activate(with model: Model) func deactivate() } class ImageComponent: UIImageView, Component { typealias Model = UIImage func activate(with model: ImageComponent.Model) { image = model } func deactivate() { image = nil } }