View controllers
Manage your interface using view controllers and facilitate navigation around your app’s content.
Overview
You use view controllers to manage your UIKit app’s interface. A view controller manages a single root view, which may itself contain any number of subviews. User interactions with that view hierarchy are handled by your view controller, which coordinates with other objects of your app as needed. Every app has at least one view controller whose content fills the main window. If your app has more content than can fit on-screen at once, use multiple view controllers to manage different parts of that content.
A container view controller embeds the content of other view controllers into its own root view. A container view controller may mix custom views with the contents of its contained view controllers to facilitate navigation or to create unique interfaces. For example, a UINavigationController object manages a navigation bar and a stack of view controllers (only one of which is visible at a time), and provides an API to add and remove view controllers from the stack.
UIKit provides several standard view controllers for navigation and managing specific types of content. You define the view controllers containing your app’s custom content. You may also define custom container view controllers to implement new navigation schemes.
Topics
Essentials
Content view controllers
Displaying and managing views with a view controllerShowing and hiding view controllersUIViewControllerUITableViewControllerUICollectionViewControllerUIContentContainer
Container view controllers
Creating a custom container view controllerUISplitViewControllerUINavigationControllerUINavigationBarUINavigationItemUITabBarControllerUITabBarUITabBarItemUITabUITabAccessoryUISearchTabUITabGroupUIPageViewController
Presentation management
Search interface
UISearchContainerViewControllerUISearchControllerUISearchBarUISearchResultsUpdatingDisplaying searchable content by using a search controllerUsing suggested searches with a search controller
Images and video
Documents and directories
Customizing a document-based app’s launch experienceAdding a document browser to your appProviding access to directoriesBuilding an app with a document browserBuilding a document browser app for custom file formatsUIDocumentViewControllerUIDocumentBrowserViewControllerUIDocumentPickerViewControllerUIDocumentInteractionController
iCloud Sharing
Activities interface
Collaborating and sharing copies of your dataUIActivityViewControllerUIActivityItemProviderUIActivityItemSourceUIActivityUIActivityItemsConfigurationProviding
Font picker
UIFontPickerViewControllerUIFontPickerViewControllerDelegateUIFontPickerViewController.Configuration