I created a custom view, but when I add it to the storyboard screen, it does not display the content (when the application is launched, everything is displayed). After seeing the lesson, I realized that I needed to add "IBDesignable" in front of the class, but that did not help, I do not see the contents in View. Moreover, now Xcode reports a rendering error:
"IB Designables: Failed to render and update auto layout status for Test1ViewController (R7h-8I-M68): The agent threw an exception.".
I ask your advice
import UIKit
@IBDesignable class ww: UIView {
var view: UIView!
@IBOutlet weak var yellowLine: UIView!
override init(frame: CGRect) {
super.init(frame: frame)
self.commonInit()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.commonInit()
}
func commonInit()
{
let view = Bundle.main.loadNibNamed("ww", owner: self, options: nil)?.first as! UIView
view.frame = self.bounds
view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
self.addSubview(view)
}
}
P.S. - I could not add images, because my reputation <10