天天看點

Push,Pop,Modal,Dismiss

//push方法

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated; 

// Uses a horizontal slide transition. Has no effect if the view controller is already in the stack.

//pop方法

- (UIViewController *)popViewControllerAnimated:(BOOL)animated;

// Returns the popped controller.

- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated; 

// Pops view controllers until the one specified is on top. Returns the popped controllers.

- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated; 

// Pops until there's only a single view controller left on the stack. Returns the popped controllers.

- (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completion NS_AVAILABLE_IOS(5_0);

// The completion handler, if provided, will be invoked after the dismissed controller's viewDidDisappear: callback is invoked.

//模态過度風格

typedef NS_ENUM(NSInteger, UIModalTransitionStyle) {

    UIModalTransitionStyleCoverVertical = 0,

    UIModalTransitionStyleFlipHorizontal,

    UIModalTransitionStyleCrossDissolve,

    UIModalTransitionStylePartialCurl NS_ENUM_AVAILABLE_IOS(3_2),

};

//dismiss

- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^)(void))completion NS_AVAILABLE_IOS(5_0);