Cocoa touch(六):UIViewController

iOS程序是基于MVC设计模式的,UIViewController是Controller的基类,一般我们通过继承这个类来实现自己的Controller,框架为我们提供了一些定义好的子类,如UINavigationController,UITabbarController

Creating a View Controller Using Nib Files

  • – initWithNibName:bundle:
  •    nibName  property
  •    nibBundle  property

Using a Storyboard

  • – shouldPerformSegueWithIdentifier:sender:
  • – performSegueWithIdentifier:sender:
  • – prepareForSegue:sender:
  •    storyboard  property
  • – canPerformUnwindSegueAction:fromViewController:withSender:

Managing the View

  •    view  property
  • – isViewLoaded
  • – loadView
  • – viewDidLoad
  •    title  property
  • – viewDidUnload Deprecated in iOS 6.0
  • – viewWillUnload Deprecated in iOS 6.0

Handling Memory Warnings

  • – didReceiveMemoryWarning

Responding to View Events

  • – viewWillAppear:
  • – viewDidAppear:
  • – viewWillDisappear:
  • – viewDidDisappear:
  • – viewWillLayoutSubviews
  • – viewDidLayoutSubviews

Testing for Specific Kinds of View Transitions

  • – isMovingFromParentViewController
  • – isMovingToParentViewController
  • – isBeingPresented
  • – isBeingDismissed

Configuring the View’s Layout Behavior

  • – updateViewConstraints
  •    wantsFullScreenLayout  property

Configuring the View Rotation Settings

  • – shouldAutorotate
  • – supportedInterfaceOrientations
  • – preferredInterfaceOrientationForPresentation
  •    interfaceOrientation  property
  • + attemptRotationToDeviceOrientation
  • – rotatingHeaderView
  • – rotatingFooterView
  • – shouldAutorotateToInterfaceOrientation: Deprecated in iOS 6.0

Responding to View Rotation Events

  • – willRotateToInterfaceOrientation:duration:
  • – willAnimateRotationToInterfaceOrientation:duration:
  • – didRotateFromInterfaceOrientation:
  • – didAnimateFirstHalfOfRotationToInterfaceOrientation: Deprecated in iOS 5.0
  • – willAnimateFirstHalfOfRotationToInterfaceOrientation:duration: Deprecated in iOS 5.0
  • – willAnimateSecondHalfOfRotationFromInterfaceOrientation:duration: Deprecated in iOS 5.0

Responding to Containment Events

  • – willMoveToParentViewController:
  • – didMoveToParentViewController:

Adding Editing Behaviors to Your View Controller

  •    editing  property
  • – setEditing:animated:

Managing State Restoration

  •    restorationIdentifier  property
  •    restorationClass  property
  • – encodeRestorableStateWithCoder:
  • – decodeRestorableStateWithCoder:

Presenting Another View Controller’s Content

  • – presentViewController:animated:completion:
  • – dismissViewControllerAnimated:completion:
  •    modalTransitionStyle  property
  •    modalPresentationStyle  property
  •    definesPresentationContext  property
  •    providesPresentationContextTransitionStyle  property
  • – disablesAutomaticKeyboardDismissal
  • – dismissModalViewControllerAnimated: Deprecated in iOS 6.0
  • – presentModalViewController:animated: Deprecated in iOS 6.0

Getting Other Related View Controllers

  •    presentingViewController  property
  •    presentedViewController  property
  •    parentViewController  property
  •    navigationController  property
  •    splitViewController  property
  •    tabBarController  property
  •    searchDisplayController  property
  •    modalViewController  property Deprecated in iOS 6.0

Managing Child View Controllers in a Custom Container

  •    childViewControllers  property
  • – addChildViewController:
  • – removeFromParentViewController
  • – shouldAutomaticallyForwardRotationMethods
  • – shouldAutomaticallyForwardAppearanceMethods
  • – transitionFromViewController:toViewController:duration:options:animations:completion:
  • – beginAppearanceTransition:animated:
  • – endAppearanceTransition
  • – viewControllerForUnwindSegueAction:fromViewController:withSender:
  • – segueForUnwindingToViewController:fromViewController:identifier:
  • – automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers Deprecated in iOS 6.0

Configuring a Navigation Interface

  •    navigationItem  property
  • – editButtonItem
  •    hidesBottomBarWhenPushed  property
  • – setToolbarItems:animated:
  •    toolbarItems  property

Configuring Tab Bar Items

  •    tabBarItem  property

Configuring Display in a Popover Controller

  •    contentSizeForViewInPopover  property
  •    modalInPopover  property

转载于:https://www.cnblogs.com/iprogrammer/p/3252711.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值