SKSlideViewController is an easy to use, slide-to-navigate view controller for ios 6.0 +. It enables you to present a main view controller and an optional, direction-sensitive accessory view controller. It is easy to setup and modify.
###How To (Using Storyboard IDs)
-
Create A New Project (Sample)
-
Import SKSlideViewController to the project
-
In the storyboard add 4 View Controllers. SKSlideViewController,MainViewController, LeftViewController and RightViewController
-
Set the the custom class of one of the controller to SKSlideViewController.
-
Add Storyboard ID of the MainViewController, LeftViewController and RightViewController to MainVC, LeftVC and RightVC respectively.
-
Create a modal segue from InitialViewController(SAViewController) to SKSlideViewController and name it as SlideVC.
-
In the InitialViewController's implementation file add the following method.
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ if([segue.identifier isEqualToString:@"SlideVC"]){ SKSlideViewController *slideController=(SKSlideViewController *)[segue destinationViewController]; [slideController setStoryBoardIDForMainController:@"MainVC" leftController:@"LeftVC" rightController:@"RightVC"]; [slideController reloadControllers]; } }
-
Test and run the code. You could see MainViewController which can be slided to left and right to reveal LeftViewController and RightViewController.
-
Next see implementing SKSlideViewDelegate