I implement a custom view by subclassing UIViewand using @IBInspectablefor some of my variables. Two of them are UIImage. If I try to access one of them in the code, the interface constructor will exit with the following message:
file:///PathToMyProject/MyProject/Pod/Classes/UI/View/MyView.xib: error: IB Designables: Failed to update auto layout status: The agent crashed
and
file:
Everything works fine on the simulator and device. Here, as you can reproduce it, it is assumed that it image_one.pngis in assets:
import UIKit
@IBDesignable
class MyView: UIView {
@IBInspectable
var anImage: UIImage = UIImage(named: "image_one")!
}
In fact, the interface initialization agent is reset when this variable is initialized. If you write var anImage: UIImage! = UIImage(named: "image_one"), then the agent crashes when accessing this variable (as indicated above).
Any ideas?