iOS Guides | Samples

UIKit.UIViewController Class

Base class for classes that manage the interaction between Model classes and View classes

See Also: UIViewController


See Also


The UIViewController class is the base class of the View Controller hierarchy. View Controllers manage UIViews and other UIViewControllers. An iOS application has a single window, but many screens, each of which may contain several UIViews. Managing those screens is complex and requires responding to both user input and changes in the model (problem domain). This management and coordination is the job of the UIViewController.

A UIViewController has 3 major responsibilities:

  • Layout out its component UIViews. This includes sizing, responding to orientation changes, etc.
  • Restructure the display in response to input events or the state of Model classes
  • Translate user input into platform-neutral Model service requests

iOS provides a number of standard view controllers such as UINavigationController, UITabBarController, and UIPageViewController. In general, the application developer should prefer to use standard view controllers to create the overall display structure. Using standard view controllers provides consistent, standard behavior and makes it easier for the app to conform to the iOS Human Interface Guidelines.

Additionally, the application developer generally needs to implement one or more “Content View Controllers”. These are often derived directly from UIViewController or UITableViewController. Content View Controllers are where the application developer writes the custom code to satisfy the UIViewControllers responsibilities described previously. In applications that take advantage of Xamarin Studio’s Code Behind facilities for Apple’s Interface Builder, much of this custom code will be automatically generated by Xamarin Studio. Applications written using MonoTouch.Dialog do not generally need a custom-written Content View Controller, but may use one for architectural consistency.

A single View Controller may have many views and subcontrollers, but typically a single View Controller will have a single root view and be primarily concerned with controlling that one view or it will be primarily concerned with maintaining a collection of subcontrollers. In the following example, taken from the “Hello World iPhone” sample, a Content View Controller of type HelloWorld_iPhoneViewController is instantiated and set to be the UIWindow.RootViewController for the application’s window:

C# Example

public override bool FinishedLaunching (UIApplication app, NSDictionary options)
       // create a new window instance based on the screen size
       window = new UIWindow (UIScreen.MainScreen.Bounds);
       viewController = new HelloWorld_iPhoneViewController ("HelloWorld_iPhoneViewController", null);
       window.RootViewController = viewController;
       window.MakeKeyAndVisible ();
       return true;

By contrast, the following code taken from the "iOS Standard Controls" sample demonstrates how a UITableViewController uses an application-defined NavItemGroup to manage a series of other UIViewControllers. In this code, the second parameter to the NavItem constructor is the specific UIViewController subtype desired when that item is selected in the table:

C# Example

navGroup = new NavItemGroup ("Toolbars");
navItems.Add (navGroup);
navGroup.Items.Add (new NavItem ("Toolbar 1", "", typeof(Toolbar.Toolbar1_iPhone)));
navGroup.Items.Add (new NavItem ("Programmatic Toolbar", "", typeof(Toolbar.ProgrammaticToolbar_Controller)));
navGroup.Items.Add (new NavItem ("Toolbar Items", "", typeof(Toolbar.ToolbarItems)));
// create a table source from our nav items
tableSource = new NavItemTableSource (this.NavigationController, navItems);
// set the source on the table to our data source
base.TableView.Source = tableSource;

UIViewController and the MVC Architecture

The following illustration shows the classic relationship between Model, View, and Controller classes. The arrows indicate dependencies: the View depends on the Model class to provide data, the Controller depends on the Model class for information about what to display and depends on the View class to do the drawing. This diagram is idealized: there would be several classes in the Model, several Views, UIView can actually use UIResponder.NextResponder to determine their UIViewController, etc.

  • The Model class has no knowledge of the associated View and Controller classes. This allows the Model to evolve independently and greatly improves maintainability and portability
  • Event handlers are used between the areas of concern. This allows for strongly-typed EventArgs that only contain the data relating to that event. This improves maintainability by limiting the client object’s access to the event-provider’s scope.
  • The Controller reacts to events both from the View and from the Model. A UIViewController might, for instance, handle a UIControl.TouchUpInside input event by requesting the Model to convert between Celsius and Fahrenheit temperature units. Conversely it might respond to a Model “too hot” event by changing the display (making visible a warning icon or somesuch). The View updates its display in reaction to new data provided by Model events. View classes should be as passive as possible. One of the most common mistakes in non-maintainable software is a View class that acts as a Controller or that "reaches into" the Model for data rather than accepting values passed in as event arguments.

UIViewController, Interface Builder, Storyboards, and Nib files

XCode, Apple’s IDE, contains Interface Builder (“IB”), a tool that allows user interfaces to be created interactively and saved as “Nib” files (these are saved in XML format with the “.xib” extension). Xamarin Studio generates Code Behind classes for nib files and generally these will be subclasses of UIViewController. Starting with iOS 5, application developers can use “Storyboards” to visually specify navigation amongst individual UIViewControllers. For more on Storyboards, see Introduction to Storyboards.

Universal applications

Xamarin Studio fully supports universal applications that use a single UIViewController to control multiple UIViews customized for the iPad or the iPhone. As long as the UIViews used by the two devices share the same elements, they can share the same Outlets and Actions, as described in the "iPad + Universal (iPhone + iPad) Apps" guide.

It is not necessary for the iPhone and iPad versions to use the same UI elements, however. The application developer may wish to take advantage of the increased screen real-estate and larger set of controls available on the iPad. In such cases, the application developer should create separate UIViewControllers and load them appropriatel using code similar to the following, again taken from the “iPad + Universal (iPhone + iPad) Apps“ guide. The choice of the UIViewController to be loaded is determined at runtime based on a call to CurrentDevice.UserInterfaceIdiom.

C# Example

if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
    homeScreen = new Screens.HomeScreen_iPhone();
} else {
    homeScreen = new Screens.HomeScreen_iPad();
window.RootViewController = homeScreen;

State Restoration

If you want to provide state restoration in your class, you need to manually add a method with the following signature to your class:

C# Example

[Adopts ("UIViewControllerRestoration")]
class MyUIViewController : UIViewController {

 [Export ("viewControllerWithRestorationIdentifierPath:")]
 static UIViewController FromIdentifierPath (string [] identifierComponents, NSCoder coder)
    var sb = (UIStoryboard) coder.DecodeObject (UIStateRestoration.ViewControllerStoryboardKey);
    if (sb != null){
       var vc = (MyUIViewController) sb.InstantiateViewController ("MyViewController");
       vc.RestorationIdentifier = identifierComponents [identifierComponents.Length-1];
       vc.RestorationClass = Class.GetHandle (typeof (MyViewController));

UIViewController Subclasses

ClassUse-caseExample Image
UIActivityViewControllerChoose from a set of possible activities

UIPageViewControllerPresents content view controllers as a series of pages

UINavigationControllerPresents content view controllers one at a time, with a header and optional toolbar

UIImagePickerControllerA standard UINavigationController for selecting and taking photographs.

UIVideoEditorControllerA standard UINavigationController for reviewing and editing video and audio files.

UITabBarControllerTop-level controller that presents view controllers one at a time, selected by a toolbar along the bottom of the screen.

UIReferenceLibraryViewControllerA standard view controller that presents a term and it's dictionary definition.

UISplitViewControllerAn iPad-only view controller that presents side-by-side view controllers.

UICollectionViewControllerEfficiently displays a large number of cells, arranged in a flexible manner.

UITableViewControllerEfficiently displays a large number of cells, arranged vertically.

Adaptive Layout and Rotation

Starting with iOS 8 a series of idioms were introduced into iOS 8 to assist developers in creating applications and UIViewControllers that would work with different form factors, like both iPhone and iPad.

This replaces the pre-iOS8 design that focused on supporting two different form factors (iPhone or iPad) in a particular orientation as well as supporting the transitions from one interface orientation to the other.

New applications should take a number of variables into consideration when laying out the elements on their UI. These include the available size in the canvas, UserInterfaceIdiom (iPad or iPhone), the display scale, and both the vertical and horizontal size classes. The first one is the size of your main view, while the rest are stored in the UIViewController.TraitCollection.

Rotation is now considered a class size change. For example an iPhone held in portrait mode has a regular height and a compact width. When you switch it to landscape, it becomes a compact height and a regular width.

Applications can override UIViewController.TraitCollectionDidChange to react to changes to any of the user interface traits. This method will be invoked during rotations or changes to the user interface that affect the size class of the application.

The UIViewController.ViewWillTransitionToSize method is invoked when rotation takes place.


.NET developers will be familiar with Microsoft-promoted architectures that serve the same goal as MVC. Both Model-View-Presenter (MVP) and Model-View-ViewModel (MVVM) strive to maintain the separation between Model classes and display classes. Developers familiar with MVP will be used to Model data flowing through a coordinating Presenter object towards the View rather than MVC’s model in which Views directly subscribe to Model events. It is possible to do an MVP architecture in iOS by increasing the responsibilities of a UIViewController. The defining characteristic of MVVM is the use of databinding to ensure that View objects are reactive. iOS controls do not support databinding so MVVM is not possible. MVVM developers will be used to more of a "firewall" between View and Model objects than is available in MVC. MVVM developers should remind themselves to ensure their View objects are as reactive as possible and are not reaching in to the Model for data or taking over Controller responsibilities.

UIViewController and MonoTouch.Dialog

MonoTouch.Dialog (“MT.D”) allows complex UIs to be rapidly built using declarative statements. As opposed to applications built using Apple’s Interface Builder, most MT.D applications use the predefined DialogViewController and do not create their own subclass of UIViewController. For more information, refer to the MonoTouch.Dialog namespace documentation and the article Introduction to MonoTouch.Dialog.

Related content


Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions:

The members of UIKit.UIViewController are listed below.

See Also: UIResponder

Public Constructors

Default constructor that initializes a new instance of this class with no parameters.
A constructor that initializes the object from the data stored in the unarchiver object.
A constructor used when creating a view controller using the information that is stored in the nib file.

Protected Constructors

Constructor to call on derived classes to skip initialization and merely allocate the object.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

AdditionalSafeAreaInsetsUIEdgeInsets. Gets or sets additional safe area insets to account for app-specific tool bars and other app-specific UI.
AutomaticallyAdjustsScrollViewInsetsBoolean. Developers should not use this deprecated property. Developers should use 'UIScrollView.ContentInsetAdjustmentBehavior' instead.
AutomaticallyForwardAppearanceAndRotationMethodsToChildViewControllersBoolean. Determines whether the containment events are automatically propagaged to nested view controllers.
BottomLayoutGuideIUILayoutSupport. Developers should not use this deprecated property. Instead, they should use UIView.SafeAreaLayoutGuide.
ChildViewControllerForHomeIndicatorAutoHiddenUIViewController. Gets a child view controller for determining whether to display an indicator for returning to the Home screen.
ChildViewControllerForScreenEdgesDeferringSystemGesturesUIViewController. Gets the child view controller that has precedence when processing screen edge gestures, if present.
ChildViewControllersUIViewController[]. An array of UIViewControllers that are managed by this UIViewController.
ClassHandleIntPtr. The handle for this class.
ContentSizeForViewInPopoverCGSize. Default content size for popovers.
DefinesPresentationContextBoolean. Specifies whether this UIViewController’s UIViewController.View is shown when presenting another UIViewController.
DisablesAutomaticKeyboardDismissalBoolean. If true, input view will remain on-screen even when non-input control is tapped.
EdgesForExtendedLayoutUIRectEdge. Specifies how the UIViewController.ParentViewController should extend the layout of this UIViewController.
EditButtonItemUIBarButtonItem. A UIBarButtonItem that toggles between statees "Edit" and "Done."
EditingBoolean. true if the UIViewController allows the application user to edit the UIView contents.
ExtendedLayoutIncludesOpaqueBarsBoolean. Whether the extended layout includes opaque bars.
ExtensionContextNSExtensionContext. Gets the NSExtensionContext for this view controller.
FocusItemContainerIUIFocusItemContainer. Gets the container for the focus envirnoment's children.
HidesBottomBarWhenPushedBoolean. Specifies whether the toolbar should be visible when this UIViewController is pushed onto a UINavigationController.
HierarchyInconsistencyExceptionNSString. Constant used to identify broken UIViewController hierarchies.
InterfaceOrientationUIInterfaceOrientation. The current orientation of the interface.
IsBeingDismissedBoolean. true if the current UIViewController is in the process of being dismissed.
IsBeingPresentedBoolean. true if the current UIViewController is in the process of being presented.
IsMovingFromParentViewControllerBoolean. true if the current UIViewController is in the process of being removed from its parent UIViewController.
IsMovingToParentViewControllerBoolean. true if the current UIViewController is in the process of being added to a parent UIViewController.
IsViewLoadedBoolean. A Boolean indicating whether the UIViewController.View is loaded into memory.
ModalInPopoverBoolean. true if this UIViewController should be presented modally by a UIPopoverController.
ModalPresentationCapturesStatusBarAppearanceBoolean. Whether the UIViewController, when presented modally but non-fullscreen, takes over control of the status bar.
ModalPresentationStyleUIModalPresentationStyle. The UIModalPresentationStyle to be used when presenting UIViewControllers.
ModalTransitionStyleUIModalTransitionStyle. The UIModalTransitionStyle to be used by UIViewController.PresentViewController.
ModalViewControllerUIViewController. Controller for the active presented view.
NavigationControllerUINavigationController. The nearest ancestor UINavigationController
NavigationItemUINavigationItem. A UINavigationItem that represents this UIViewController in its parent’s UINavigationController’s UINavigationController.UINavigationBar.
NibBundleNSBundle. The NSBundle from which this UIViewController was instantiated.
NibNameString. The name of the nib file from which this UIViewController was instantiated, or null.
ParentFocusEnvironmentIUIFocusEnvironment. Gets the focus environment that contains the current focus environment.
ParentViewControllerUIViewController. The UIViewController that contains this UIViewController.
PopoverPresentationControllerUIPopoverPresentationController. Gets the nearest ancestor in the view hierarchy that is a UIPopoverPresentationController or null if there is none.
PreferredContentSizeCGSize. Gets the preferred size for the content of the container.
PreferredFocusedViewUIView. If not null, indicates the child UIView that should receive focus by default.
PreferredFocusEnvironmentsIUIFocusEnvironment[]. An array of IUIFocusEnvironments that are recursively searched by the system to find the default focused view.
PreferredScreenEdgesDeferringSystemGesturesUIRectEdge. Gets the screen edges whose gestures take precedence over system gestures.
PreferredStatusBarUpdateAnimationUIStatusBarAnimation. The preferred animation style for hiding and showing the status bar.
PrefersHomeIndicatorAutoHiddenBoolean. Gets a Boolean value that tells if it is preferred that the Home indicator be hidden.
PresentationControllerUIPresentationController. Gets the nearest ancestor in the view hierarchy that is a UIPresentationController or null if there is none.
PresentedViewControllerUIViewController. The UIViewController that is being presented by this UIViewController or one of this’s ancestor UIViewControllers.
PresentingViewControllerUIViewController. The UIViewController that is presenting this UIViewController.
PreviewActionItemsIUIPreviewActionItem[]. Gets the array of IUIPreviewActionItem that are displayed when the user swipes upwards in 3D Touch Preview.
ProvidesPresentationContextTransitionStyleBoolean. true if this UIViewController overrides the transition style of the UIViewController that it presents.
RestorationClassClass. The class responsible for restoring application state.
RestorationIdentifierString. Specifies the instance of the UIViewController for restoration.
RestoresFocusAfterTransitionBoolean. Gets or sets whether this UIViewController restores focus after being transitioned to.
RotatingFooterViewUIView. The footer view that needs to be transitioned during an interface rotation
RotatingHeaderViewUIView. The header view that needs to be transitioned during an interface rotation.
SearchDisplayControllerUISearchDisplayController. The UISearchDisplayController, if any, associated with this UIViewController.
ShouldAutomaticallyForwardAppearanceMethodsBoolean. Whether appearance methods should be forwarded to child UIViewControllers.
ShouldAutomaticallyForwardRotationMethodsBoolean. Whether rotation methods should be forwarded to child UIViewControllers.
ShowDetailTargetDidChangeNotificationNSString. Notification constant for ShowDetailTargetDidChange
SplitViewControllerUISplitViewController. The nearest ancestor UISplitViewController or null.
StoryboardUIStoryboard. The UIStoryboard from which this UIViewController was created, or null.
SystemMinimumLayoutMarginsNSDirectionalEdgeInsets. Gets the root view's minimum layout margins.
TabBarControllerUITabBarController. The nearest ancestore UITabBarController or null.
TabBarItemUITabBarItem. A UITabBarItem that represents this UIViewController in its parent’s UITabBarController’s UITabBarController.UITabBar.
TitleString. A human-meaningful identifier of this UIViewController.
ToolbarItemsUIBarButtonItem[]. The array of UIBarButtonItems on a UINavigationController’s UINavigationController.Toolbar
TopLayoutGuideIUILayoutSupport. Developers should not use this deprecated property. Instead, they should use UIView.SafeAreaLayoutGuide.
TraitCollectionUITraitCollection. Characteristics of the display, such as it's idiom, scale, and size class.
TransitioningDelegateIUIViewControllerTransitioningDelegate. A delegate object that is responsible for producing IUIViewControllerAnimatedTransitionings for custom presentation.
ViewUIView. The view managed by this view controller.
ViewIfLoadedUIView. Returns the UIViewController.View if it has been instantiated; otherwise, returns null.
ViewRespectsSystemMinimumLayoutMarginsBoolean. Gets or sets a Boolean value that controls whether the view for the view controller respects the minimum layout margins.
WantsFullScreenLayoutBoolean. true if the view should overlap the status bar.
WeakTransitioningDelegateNSObject. The delegate object used to provide controllers for transition animations and interactions.

Public Methods

This is an alias for UIView.AddSubview, but uses the Add pattern as it allows C# 3.0 constructs to add subviews after creating the object.
Adds a UIViewController as a child.
Adds command as a shortcut available to attached hardware keyboards.
Called when object decoding is complete during state restoration.
Programmatically triggers rotation of views.
BeginAppearanceTransition(Boolean, Boolean)
With UIViewController.EndAppearanceTransition, tells child UIViewControllers that their UIViews are about to either appear or disappear.
Method that is called when the host app is about to make a request.
CanPerformUnwind(Selector, UIViewController, NSObject) : Boolean
Specifies whether this UIViewController supports the specific unwind segue
ChildViewControllerForStatusBarHidden() : UIViewController
When overridden, returns the UIViewController that determines whether the status bar is hidden or unhidden.
ChildViewControllerForStatusBarStyle() : UIViewController
When overridden, returns the UIViewController that determines the style of the status bar.
With UIViewController.EncodeRestorableState, allows custom state restoration.
Deprecated function called at end of first-part of two-step rotation animations.
Called after this is added or removed from a parent UIViewController.
Called when the system is running low on memory.
Called after the UI has rotated.
DidUpdateFocus(UIFocusUpdateContext, UIFocusAnimationCoordinator)
Indicates that the focus changed as detailed in the context.
Dismisses the modal view controller that was submitted by the receiver.
Dismisses the MPMoviePlayerViewController.
DismissViewController(Boolean, Action)
Dismisses the presented view controller.
DismissViewControllerAsync(Boolean) : Task
Dismisses the presented view controller.
With UIViewController.DecodeRestorableState, allows custom state restoration.
Encodes the state of the object on the provided encoder
With UIViewController.BeginAppearanceTransition, tells child UIViewControllers that their child views have just appeared or disappeared.
GetAllowedChildViewControllersForUnwinding(UIStoryboardUnwindSegueSource) : UIViewController[]
The array of child UIViewController objects that should be searched to determine if they are the unwind segue destination.
GetChildViewControllerContainingSegueSource(UIStoryboardUnwindSegueSource) : UIViewController
The child UIViewController that is the source of the unwind segue.
GetEnumerator() : IEnumerator
Returns an enumerator that lists all of the child UIViews
GetOverrideTraitCollectionForChildViewController(UIViewController) : UITraitCollection
Gets the UITraitCollection for the specified child view controller of this controller.
GetSegueForUnwinding(UIViewController, UIViewController, String) : UIStoryboardSegue
Defines the segue to be used between two UIViewControllers.
GetSizeForChildContentContainer(IUIContentContainer, CGSize) : CGSize
Gets the size of the content of the specified child IUIContentContainer by using the size of the parent container.
GetSupportedInterfaceOrientations() : UIInterfaceOrientationMask
The orientations supported by this UIViewController.
GetTargetViewControllerForAction(Selector, NSObject) : UIViewController
Gets the view controller for the specified action and sender.
GetViewControllerForUnwind(Selector, UIViewController, NSObject) : UIViewController
Used for searching child UIViewControllers for a specific unwind segue.
Initializes the UIViewController.View property.
If necessary, synchronously loads the UIViewController.View from a Storyboard or NIB.
PerformSegue(String, NSObject)
Performs the specified UIStoryboardSegue.
Notifies this controller that the preferred size for content for a specified child container has changed.
PreferredInterfaceOrientationForPresentation() : UIInterfaceOrientation
The orientation that best displays the content of this UIViewController.
PreferredStatusBarStyle() : UIStatusBarStyle
The preferred UIStatusBarStyle for this UIViewController.
PrefersStatusBarHidden() : Boolean
Whether this UIViewController prefers the status bar to be hidden.
Prepares the view controller to display interstitial ads.
PrepareForSegue(UIStoryboardSegue, NSObject)
Informs the application that a UIStoryboardSegue is about to be executed.
PresentModalViewController(UIViewController, Boolean)
Application developers should use UIViewController.PresentViewController instead of this deprecated method.
Displays a movie controller using the standard transition.
PresentViewController(UIViewController, Boolean, Action)
Modally presents a view controller.
PresentViewControllerAsync(UIViewController, Boolean) : Task
Modally presents a view controller.
RegisterForPreviewingWithDelegate(IUIViewControllerPreviewingDelegate, UIView) : IUIViewControllerPreviewing
Registers this view controller for 3D Touch peek and pop operations.
Removes this UIViewController from its UIViewController.ParentViewControllerUIViewController.
Removes a previously-added hardware-keyboard accelerator.
SetEditing(Boolean, Boolean)
Turns editing mode on or off.
When this is the active focus environment, requests a focus update, which can potentially change the UIView.PreferredFocusView. (See also UIView.UpdateFocusIfNeeded.)
Notifies the system that the attributes of the status bar have been changed.
Controls whether the developer's view controller should display the indicator for returning to the Home screen..
Changes the screen edges whose gestures take precedence over system gestures.
SetOverrideTraitCollection(UITraitCollection, UIViewController)
Sets the UITraitCollection object for the specified child view controller of this controller.
SetToolbarItems(UIBarButtonItem[], Boolean)
Adds UIBarButtonItems to the UIToolbar
ShouldAutorotate() : Boolean
Turns auto-rotation on or off.
ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation) : Boolean
true if the UIViewController supports rotation to the specified UIInterfaceOrientation.
ShouldPerformSegue(String, NSObject) : Boolean
Whether the segue should be performed.
ShouldUpdateFocus(UIFocusUpdateContext) : Boolean
Called prior to the this either losing or receiving focus. If either focus environment returns false, the focus update is canceled.
ShowDetailViewController(UIViewController, NSObject)
Shows this view controller in a detail context.
ShowViewController(UIViewController, NSObject)
Shows this view controller.
Notifies this container that auto layout resized a specified child container.
Method invoked when the trait collection for the view controller changed.
Transition(UIViewController, UIViewController, Double, UIViewAnimationOptions, Action, UICompletionHandler)
Used for transitioning between two view controller'€™s child view controllers.
TransitionAsync(UIViewController, UIViewController, Double, UIViewAnimationOptions, Action) : System.Threading.Tasks.Task<bool>
Used for transitioning between two view controller'€™s child view controllers.
Stops previewing from handling 3D Touch peek and pop input.
Unwind(UIStoryboardSegue, UIViewController)
Called during an unwind segue on any UIViewController objects in the unwind path.
If any focus environment has a pending update, this method forces an immediate focus update. Unlike UIViewController.SetNeedsFocusUpdate, this method may be called by any UIViewController, whether it currently contains focus or not.
Called when the UIViewController needs to recalculate its layout constraints.
Called after the UIViewController.View is added to the view hierarchy.
This method is called after the UIViewthat is this UIViewController’s UIViewController.View property is removed from the display UIView hierarchy.
Called after the UIViewController.View has laid out its subviews.
Called after the controller’s UIViewController.View is loaded into memory.
In iOS 6 and later, this method is never called. In prior versions it was called when the controller’s view was released from memory.
Method that is called when the layout margins for the view are changed.
Method that is called when the safe area insets are changed by size changes to system bars or by changes to the UIViewController.AdditionalSafeAreaInsets property.
Called prior to the UIViewController.View being added to the view hierarchy.
This method is called prior to the removal of the UIViewthat is this UIViewController’s UIViewController.View from the display UIView hierarchy.
Called before the UIViewController.View lays out its subviews.
ViewWillTransitionToSize(CGSize, IUIViewControllerTransitionCoordinator)
For UIViewController objects that are part of an app extension, called prior to the UIViewController.View being resized.
In iOS 6 and later, this method is never called. In prior versions it was called prior to the controller’s view was released from memory.
WillAnimateFirstHalfOfRotation(UIInterfaceOrientation, Double)
Deprecated method sent during the first half of a rotation. Application developers should instead use UIViewController.WillAnimateRotation.
WillAnimateRotation(UIInterfaceOrientation, Double)
Called prior to a one-step interface rotation.
WillAnimateSecondHalfOfRotation(UIInterfaceOrientation, Double)
Deprecated method sent during the second half of a rotation. Application developers should instead use UIViewController.WillAnimateRotation.
Called prior to adding or removing this from a container UIViewController.
WillRotate(UIInterfaceOrientation, Double)
Called prior to a user interface rotation.
WillTransitionToTraitCollection(UITraitCollection, IUIViewControllerTransitionCoordinator)
Notifies this that its trait collection will change to traitCollection, as coordinated by coordinator.

Protected Methods

Releases the resources used by the UIViewController object.