Can UIViewController contain more than one UIView?

Can it UIViewcontroller

contain more than one UIView

?

+2


source to share


2 answers


Yes many.



Every button, text box or image, or ... represents a view. The view controller can handle many kinds of views. Of course, there is one view that is the parent of all the others and the view controller keeps track of that file and then can follow the tree down to handle children (to handle touch or update, etc.).

+4


source


For clarity, NO. UIViewController has one UIView. This UIView, like all UIViews, can contain subviews. If you want to control two views, create instance variables for each one and add them as a UIViewController view variable.



+1


source







All Articles