最終更新:2017-06-06 (火) 18:35:14 (888d)  

UIViewController はてなブックマークを見る
Top / UIViewController

すべてのView Controllerオブジェクトの基底クラス

  • ビューのロードと表示、(デバイスの回転に応じた)表示の回転など、システムの標準的な動作が実装されている

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html

なんぞや

  • View Controllerの基本クラスは、一連のビューをプログラムの中で作成したり、NIBファイルからロードしたりするためのワークフローを提供しています。また、オペレーティングシステムと連携して、メモリ不足状態の間は、これらのビューをメモリから削除し、後で必要になったときに再構築する処理も行います。
  • View Controllerは、ユーザがデバイスを回転したときにインターフェイスの向きを変更する動作や、現在のコンテンツの手前にほかのビューを一時的に表示する動作など、標準的なシステム動作のいくつかを自動的にサポートします。

メソッドとか

Creating a View Controller Using Nib Files

Using a Storyboard

  • UIViewController shouldPerformSegueWithIdentifier:sender?
  • UIViewController performSegueWithIdentifier:sender?
  • UIViewController prepareForSegue:sender?
  • UIViewController storyboard? - プロパティ (UIStoryboard)
  • UIViewController canPerformUnwindSegueAction:fromViewController:withSender?

Managing the View

Handling Memory Warnings

  • UIViewController.didReceiveMemoryWarning?

Responding to View Events

  • UIViewController viewWillAppear?
  • UIViewController viewDidAppear?
  • UIViewController viewWillDisappear?
  • UIViewController viewDidDisappear?
  • UIViewController viewWillLayoutSubviews?
  • UIViewController viewDidLayoutSubviews?

Testing for Specific Kinds of View Transitions

  • UIViewController isMovingFromParentViewController?
  • UIViewController isMovingToParentViewController?
  • UIViewController isBeingPresented?
  • UIViewController isBeingDismissed?

Configuring the View’s Layout Behavior

  • UIViewController updateViewConstraints?
  • UIViewController wantsFullScreenLayout? - プロパティ (BOOL)

Configuring the View Rotation Settings

Responding to View Rotation Events

  • UIViewController willRotateToInterfaceOrientation:duration?
  • UIViewController willAnimateRotationToInterfaceOrientation:duration?
  • UIViewController didRotateFromInterfaceOrientation?
  • UIViewController didAnimateFirstHalfOfRotationToInterfaceOrientation? - Deprecated in iOS 5.0
  • UIViewController willAnimateFirstHalfOfRotationToInterfaceOrientation:duration? - Deprecated in iOS 5.0
  • UIViewController willAnimateSecondHalfOfRotationFromInterfaceOrientation:duration? - Deprecated in iOS 5.0

Responding to Containment Events

  • UIViewController willMoveToParentViewController?
  • UIViewController didMoveToParentViewController?

Adding Editing Behaviors to Your View Controller

  • UIViewController editing? - プロパティ (BOOL)
  • UIViewController setEditing:animated?

Managing State Restoration

  • UIViewController restorationIdentifier? - プロパティ (NSString)
  • UIViewController restorationClass? - property
  • UIViewController encodeRestorableStateWithCoder?
  • UIViewController decodeRestorableStateWithCoder?

Presenting Another View Controller’s Content

  • UIViewController presentViewController:animated:completion
  • UIViewController dismissViewControllerAnimated:completion?
  • UIViewController modalTransitionStyle? - プロパティ (UIModalTransitionStyle?)
  • UIViewController modalPresentationStyle? - プロパティ (UIModalPresentationStyle?)
  • UIViewController definesPresentationContext? - property
  • UIViewController providesPresentationContextTransitionStyle? - プロパティ (BOOL)
  • UIViewController disablesAutomaticKeyboardDismissal?
  • UIViewController dismissModalViewControllerAnimated? - Deprecated in iOS 6.0
  • UIViewController presentModalViewController:animated? - Deprecated in iOS 6.0

Getting Other Related View Controllers

Managing Child View Controllers in a Custom Container

  • UIViewController childViewControllers? - プロパティ (NSArray)
  • UIViewController addChildViewController?
  • UIViewController removeFromParentViewController?
  • UIViewController shouldAutomaticallyForwardRotationMethods?
  • UIViewController shouldAutomaticallyForwardAppearanceMethods?
  • UIViewController transitionFromViewController:toViewController:duration:options:animations:completion?
  • UIViewController beginAppearanceTransition:animated?
  • UIViewController endAppearanceTransition?
  • UIViewController viewControllerForUnwindSegueAction:fromViewController:withSender?
  • UIViewController segueForUnwindingToViewController:fromViewController:identifier?
  • UIViewController automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers? - Deprecated in iOS 6.0

Configuring a Navigation Interface

  • UIViewController navigationItem? - プロパティ (UINavigationItem)
  • UIViewController editButtonItem?
  • UIViewController hidesBottomBarWhenPushed? - プロパティ (BOOL)
  • UIViewController setToolbarItems:animated?
  • UIViewController toolbarItems? - プロパティ (NSArray)

Configuring Tab Bar Items

  • UIViewController tabBarItem? - プロパティ (UITabBarItem?)

Configuring Display in a Popover Controller

  • UIViewController contentSizeForViewInPopover? - プロパティ (CGSize)
  • UIViewController modalInPopover? - プロパティ (BOOL)

サブクラス

Objective-C/起動プロセス

各メソッドの役割おさらい

回転

ビューの切り替え時のイベント