As Martin R said you can't add stored properties to a class through class extensions. But you can use the objective C associated objects to do it via an extension
private var key: Void?
extension UIImageView {
public var isFlipped: Bool? {
get {
return objc_getAssociatedObject(self, &key) as? Bool
}
set {
objc_setAssociatedObject(self,
&key, newValue,
.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
}
}