RBNavigationController Class Reference

Inherits from UIViewController
Conforms to UIGestureRecognizerDelegate
Declared in RBNavigationController.h

Overview

A customisable navigation controller.

  viewControllers

An array of the view controllers currently on the navigation stack.

@property (nonatomic, readonly, nonnull) NSArray *viewControllers

Declared In

RBNavigationController.h

  previousViewController

The view controller behind the currently displayed view controller.

@property (nonatomic, readonly, nullable) UIViewController *previousViewController

Declared In

RBNavigationController.h

  animator

The animator that is used to provide animated push and pop transitions.

@property (nonatomic, nonnull) RBNavigationAnimator *animator

Declared In

RBNavigationController.h

  swipePopEnabled

Whether or not the user can swipe from the edge to pop a view controller.

@property (nonatomic) BOOL swipePopEnabled

Declared In

RBNavigationController.h

  delegate

An optional delegate to be informed of navigation events.

@property (nonatomic, weak, nullable) id<RBNavigationControllerDelegate> delegate

Declared In

RBNavigationController.h

– viewControllerFromTop:

Retrieves the view controller at the given index from the top. The visible view controller has an index of 0.

- (nullable UIViewController *)viewControllerFromTop:(NSUInteger)index

Parameters

index

The index from the top of the view controller desired.

Return Value

The retrieved view controller.

Declared In

RBNavigationController.h

– pushViewController:animated:completion:

Pushes a view controller to the navigation stack.

- (void)pushViewController:(nonnull UIViewController *)viewController animated:(BOOL)animated completion:(nullable dispatch_block_t)completion

Parameters

viewController

The view controller to push to the navigation stack.

animated

Whether or not the operation should be animated.

completion

An optional block to be called when the operation is complete.

Declared In

RBNavigationController.h

– pushViewController:animator:completion:

Pushes a view controller to the navigation stack.

- (void)pushViewController:(nonnull UIViewController *)viewController animator:(nullable RBNavigationAnimator *)animator completion:(nullable dispatch_block_t)completion

Parameters

viewController

The view controller to push to the navigation stack.

animator

An Optional RBNavigationAnimator to use for animating.

completion

An optional block to be called when the operation is complete.

Declared In

RBNavigationController.h

– popToViewController:animated:completion:

Pops all view controllers above the given view controller from the navigation stack. When the operation is complete, the given view controller will be the visible view controller.

- (nonnull NSArray *)popToViewController:(nonnull UIViewController *)viewController animated:(BOOL)animated completion:(nullable dispatch_block_t)completion

Parameters

viewController

The view controller to pop to.

animated

Whether or not the operation should be animated.

completion

An optional block to be called when the operation is complete.

Return Value

An array of the view controllers that were popped.

Declared In

RBNavigationController.h

– popToViewController:animator:completion:

Pops all view controllers above the given view controller from the navigation stack. When the operation is complete, the given view controller will be the visible view controller.

- (nonnull NSArray *)popToViewController:(nonnull UIViewController *)viewController animator:(nullable RBNavigationAnimator *)animator completion:(nullable dispatch_block_t)completion

Parameters

viewController

The view controller to pop to.

animator

An Optional RBNavigationAnimator to use for animating.

completion

An optional block to be called when the operation is complete.

Return Value

An array of the view controllers that were popped.

Declared In

RBNavigationController.h

– popViewControllerAnimated:completion:

Pops the top view controller from the navigation stack.

- (nullable UIViewController *)popViewControllerAnimated:(BOOL)animated completion:(nullable dispatch_block_t)completion

Parameters

animated

Whether or not the operation should be animated.

completion

An optional block to be called when the operation is complete.

Return Value

The view controller that was popped.

Declared In

RBNavigationController.h

– popViewControllerWithAnimator:completion:

Pops the top view controller from the navigation stack using a specific optional animator.

- (nullable UIViewController *)popViewControllerWithAnimator:(nullable RBNavigationAnimator *)animator completion:(nullable dispatch_block_t)completion

Parameters

animator

An Optional RBNavigationAnimator to use for animating.

completion

An optional block to be called when the operation is complete.

Return Value

The view controller that was popped.

Declared In

RBNavigationController.h

– popToRootViewControllerAnimated:completion:

Pops all view controllers except the first view controller.

- (nonnull NSArray *)popToRootViewControllerAnimated:(BOOL)animated completion:(nullable dispatch_block_t)completion

Parameters

animated

Whether or not the operation should be animated.

completion

An optional block to be called when the operation is complete.

Return Value

An array of the view controllers that were popped.

Declared In

RBNavigationController.h

– popToRootViewControllerWithAnimator:completion:

Pops all view controllers except the first view controller using a specific optional animator.

- (nonnull NSArray *)popToRootViewControllerWithAnimator:(nullable RBNavigationAnimator *)animator completion:(nullable dispatch_block_t)completion

Parameters

animator

An Optional RBNavigationAnimator to use for animating.

completion

An optional block to be called when the operation is complete.

Return Value

An array of the view controllers that were popped.

Declared In

RBNavigationController.h

– removeViewControllersInRange:

Removes the view controllers in the given range. There is no animation for this operation.

- (void)removeViewControllersInRange:(NSRange)range

Parameters

range

The NSRange of the view controllers to remove.

Declared In

RBNavigationController.h

– removeViewControllersBetween:andViewController:

Removes all view controllers between the ones given.

- (void)removeViewControllersBetween:(nonnull UIViewController *)viewControllerA andViewController:(nonnull UIViewController *)viewControllerB

Parameters

viewControllerA

The first view controller.

viewControllerB

The second view controller.

Declared In

RBNavigationController.h