Inherits from UIViewController
Conforms to UIGestureRecognizerDelegate
Declared in MWFSlideNavigationViewController.h
MWFSlideNavigationViewController.m

Overview

The MWFSlideNavigationViewController is a container view controller implementation that manages a primary and secondary view controller.

Primary view controller is basically the root view controller provided during the class initialization using [MWFSlideNavigationViewController initWithRootViewController:] method. The primary/root view fills the whole of MWFSlideNavigationViewController view area.

Secondary view controller is the ‘hidden’ beneath the primary/root view. It is revealed by sliding the primary/root view in one of the 4 directions supported (MWFSlideDirectionUp, MWFSlideDirectionLeft, MWFSlideDirectionDown or MWFSlideDirectionRight), using [MWFSlideNavigationViewController slideForViewController:direction:portraitOrientationDistance:landscapeOrientationDistance:] method. The same method is used to slide the primary/root view back, by specifying MWFSlideDirectionNone as the slide direction.

This view controller notifies its delegate in response to the sliding event. The delegate is a custom object provided by your application that conforms to the MWFSlideNavigationViewControllerDelegate protocol. You can use the callback methods to perform additional setup or cleanup tasks.

Important: When not showing, secondary view controller is removed from slide navigation controller and not retained. It’s the responsibilty of application to retain it if needed.

Tasks

Properties

currentLandscapeOrientationDistance

The current landscape orientation slide distance.

@property (nonatomic, readonly) NSInteger currentLandscapeOrientationDistance

Discussion

The current landscape orientation slide distance.

Declared In

MWFSlideNavigationViewController.h

currentPortraitOrientationDistance

The current portrait orientation slide distance.

@property (nonatomic, readonly) NSInteger currentPortraitOrientationDistance

Discussion

The current portrait orientation slide distance.

Declared In

MWFSlideNavigationViewController.h

currentSlideDirection

The current slide direction.

@property (nonatomic, readonly) MWFSlideDirection currentSlideDirection

Discussion

The current slide direction.

Declared In

MWFSlideNavigationViewController.h

dataSource

The receiver’s dataSource or nil if it doesn’t have a dataSource.

@property (nonatomic, weak) id<MWFSlideNavigationViewControllerDataSource> dataSource

Discussion

The receiver’s dataSource or nil if it doesn’t have a dataSource.

Declared In

MWFSlideNavigationViewController.h

delegate

The receiver’s delegate or nil if it doesn’t have a delegate.

@property (nonatomic, weak) id<MWFSlideNavigationViewControllerDelegate> delegate

Discussion

The receiver’s delegate or nil if it doesn’t have a delegate.

Declared In

MWFSlideNavigationViewController.h

panEnabled

Enable panning

@property (nonatomic) BOOL panEnabled

Discussion

Enable panning

Declared In

MWFSlideNavigationViewController.h

rootViewController

The root view controller.

@property (nonatomic, strong) UIViewController *rootViewController

Discussion

The root view controller.

Declared In

MWFSlideNavigationViewController.h

Instance Methods

initWithRootViewController:

Initializes and returns a newly created slide navigation view controller.

- (id)initWithRootViewController:(UIViewController *)rootViewController

Parameters

rootViewController

The primary view controller

Return Value

The initialized slide navigation view controller or nil if there was problem initializing the object.

Discussion

Initializes and returns a newly created slide navigation view controller.

Even it’s not mandatory, each slide navigation controller should have a root view controller as its primary view controller.

Declared In

MWFSlideNavigationViewController.h

slideForViewController:direction:portraitOrientationDistance:landscapeOrientationDistance:

Perform slide animation that reveals/hides the specified viewController. If the direction is MWFSlideDirectionNone, the values provided for viewController and distances are ignored, it’s advised to just specify nil for viewController and 0 for distances.

- (void)slideForViewController:(UIViewController *)viewController direction:(MWFSlideDirection)direction portraitOrientationDistance:(CGFloat)portraitOrientationDistance landscapeOrientationDistance:(CGFloat)landscapeOrientationDistance

Parameters

viewController

The secondary view controller or nil if direction is MWFSlideDirectionNone.

direction

The slide direction: MWFSlideDirectionUp, MWFSlideDirectionLeft, MWFSlideDirectionDown, MWFSlideDirectionRight or MWFSlideDirectionNone.

portraitOrientationDistance

The distance of slide when in portrait orientation.

landscapeOrientationDistance

The distance of slide when in landscape orientation.

Discussion

Perform slide animation that reveals/hides the specified viewController. If the direction is MWFSlideDirectionNone, the values provided for viewController and distances are ignored, it’s advised to just specify nil for viewController and 0 for distances.

Declared In

MWFSlideNavigationViewController.h

slideWithDirection:

Perform slide animation with specified direction. The receiver will request view controller to be revealed from its dataSource and slide distance from its delegate.

- (void)slideWithDirection:(MWFSlideDirection)direction

Parameters

direction

The slide direction.

Discussion

Perform slide animation with specified direction. The receiver will request view controller to be revealed from its dataSource and slide distance from its delegate.

Declared In

MWFSlideNavigationViewController.h