[关闭]
@SanMao 2015-08-06T00:32:21.000000Z 字数 2070 阅读 1904

Push和Modal的区别

知识补充


Push(代码方式,storyboa方式)

  1. - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated;
  2. // Uses a horizontal slide transition. Has no effect if the view controller is already in the stack.
  3. - (UIViewController *)popViewControllerAnimated:(BOOL)animated;
  4. // Returns the popped controller.
  5. - (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated;
  6. // Pops view controllers until the one specified is on top. Returns the popped controllers.
  7. - (NSArray *)popToRootViewControllerAnimated:(BOOL)animated;
  8. // Pops until there's only a single view controller left on the stack. Returns the popped controllers.
  1. /*
  2. The next two methods are replacements for presentModalViewController:animated and dismissModalViewControllerAnimated: The completion handler, if provided, will be invoked after the presented
  3. controllers viewDidAppear: callback is invoked.
  4. */
  5. - (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completion NS_AVAILABLE_IOS(5_0);
  6. // 关闭当初Modal出来的控制器
  7. - (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^)(void))completion NS_AVAILABLE_IOS(5_0);

storyboard中通过segue跳转

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注