I am trying to access the MyCustomView from another class using the following code in ViewController.swift ..
MyCustomView
var view = MyCustomView(frame: CGR
var customView = UIView() @IBAction func drawView(_ sender: AnyObject) { customView.frame = CGRect.init(x: 0, y: 0, width: 100, height: 200) customView.backgroundColor = UIColor.black //give color to the view customView.center = self.view.center self.view.addSubview(customView) }