How to create custom view programmatically in swift having controls text field, button etc

前端 未结 5 1870
星月不相逢
星月不相逢 2020-12-08 12:51

I am trying to access the MyCustomView from another class using the following code in ViewController.swift ..

var view = MyCustomView(frame: CGR         


        
5条回答
  •  甜味超标
    2020-12-08 13:30

    let viewDemo = UIView()
    viewDemo.frame = CGRect(x: 50, y: 50, width: 50, height: 50)
    self.view.addSubview(viewDemo)
    

提交回复
热议问题