Understanding View Controller Nesting in iOS

前端 未结 3 982
天命终不由人
天命终不由人 2021-02-04 04:08

Ive been tearing my hair out over the last couple of days trying to understand this one seemingly basic concept of iOS development:

  • If I want to have two or mor

3条回答
  •  难免孤独
    2021-02-04 04:54

    The View Controller Programming Guide covers this pretty well.

    A view controller manages a set of views. You can have content view controllers and container/navigation view controllers which manage the hierarchy of view controllers (example: navigation view controller can manage a listview controller and a detail controller).

    It's covered in more detail here:

    http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007457

    A view controller manages a discrete portion of your application’s user interface. Upon request, it provides a view that can be displayed or interacted with. Often, this view is the root view for a more complex hierarchy of views — buttons, switches, and other user interface elements with existing implementations in iOS. The view controller acts as the central coordinating agent for this view hierarchy, handling exchanges between the views and any relevant controller or data objects.

    Multiple view controllers coordinate their efforts to present a single unified user interface.

提交回复
热议问题