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

前端 未结 5 1869
星月不相逢
星月不相逢 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:36

    view = MyCustomView(frame: CGRectZero)
    

    In this line you are trying to set empty rect for your custom view. That's why you cant see your view in simulator.

提交回复
热议问题