Search code examples
iosuiviewcontrollerwindowsubviewaddsubview

Can we add more than one subviews to a window at the same time in iOS?


Is it possible to add more than 1 subviews to a given window. Eg. [window addsubview: subview1] [window addsubview: subview2] where one of the views is UIViewController. I tried doing it but the UIViewController view overrides the other subview.


Solution

  • Yes you can add multiple subviews to UIWindow.

    For your problem check the frames of the views you add - probably your viewController's view is fullscreen and another view is just under it