1

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

byJeevan
  • 3,728
  • 3
  • 37
  • 60
  • please share your Tried Code ? – iOS Geek Apr 10 '18 at 04:27
  • You can check this StackOverflow Question. https://stackoverflow.com/questions/39732312/xcode-8-ib-designables-failed-to-render-and-update-auto-layout-status-the-a?answertab=votes#tab-top – DURGA_PRASAD Apr 10 '18 at 04:33

1 Answers1

0
    let refundViewVC = self.storyboard?.instantiateViewController(withIdentifier: "refundViewController") as! refundViewController

    refundViewVC.delegate = self
    refundViewVC.modalPresentationStyle = .overCurrentContext
    refundViewVC.modalTransitionStyle = .crossDissolve
    refundViewVC.definesPresentationContext = true
    refundViewVC.view.backgroundColor = UIColor.init(red: 74/255, green: 74/255, blue: 74/255, alpha: 0.5)

    self.navigationController?.present(refundViewVC, animated: true, completion: nil)

"refundViewController" is my UIViewController class.

Arjun Patel
  • 1,394
  • 14
  • 23