This question already has an answer here:
- EXC_BAD_ACCESS Using IBInspectable 1 answer
I want to have a default property of UIImageView
, which would be isFlipped
. I am able to do it by subclassing UIImageView
and adding one property isFlipped
.
But I want to user protocol and extensions for this , but it is crashing after sometime. Below is my code. How can I use it in right way? Thanks
import Foundation
import UIKit
protocol FlipImage {
var isFlipped: Bool { get set }
}
extension UIImageView:FlipImage{
var isFlipped: Bool {
get {
return self.isFlipped
}
set {
self.isFlipped = newValue
}
}
}