Advanced Slide View Controller

Advanced Slide View Controller

Released 4 years ago , Last update 4 years ago

Slide to navigate view controller for ios 6.0 + with support for storyboard and multiple orientations

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 controllers. Accessory controllers can be loaded on-demand which saves active memory.

Pricing

14 day 14-day money-back guarantee

FREE

MIT license

The MIT license is an open-source license.

$99.99

Developer License

  • Perpetual license

  • Unlimited projects

  • Can distribute code and binary products

  • Commercial use

  • 1 month support

Features

  • Load accessory view controllers on demand
  • Supports storyboard
  • Supports multiple orientations
  • Works on iPhone, iPod Touch and iPad

How to integrate

Using Storyboard IDs

  1. Create A New Project (Sample)

    Alt text

  2. Import SKSlideViewController to the project

    Alt text

    Alt text

  3. In the storyboard add 4 View Controllers. SKSlideViewController,MainViewController, LeftViewController and RightViewController

  4. Set the the custom class of one of the controller to SKSlideViewController.

    Alt text

  5. Add Storyboard ID of the MainViewController, LeftViewController and RightViewController to MainVC, LeftVC and RightVC respectively.

    Alt text

  6. Create a modal segue from InitialViewController(SAViewController) to SKSlideViewController and name it as SlideVC.

    Alt text

  7. 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];
        }
    }
  8. Test and run the code. You could see MainViewController which can be slided to left and right to reveal LeftViewController and RightViewController.

Implementing SKSlideViewDelegate

Now the connections have been made between the SKSlideViewController and the accessory view controllers. The next task is initiating communication between the connected view controllers. To achieve this the View controllers must implement SKSlideViewDelegate protocol.

In the following tutorial we will add two buttons to MainViewController on click of which will reveal the LeftViewController and RightViewController.

  1. Create new UIViewController subclass for MainViewController, LeftViewController and RightViewController.

    Alt text

    Alt text

  2. Implement SKSlideViewDelegate protocol.

    Alt text

  3. Override

    -(void)setSKSlideViewControllerReference:(SKSlideViewController *)aSlideViewController{
        self.slideController=aSlideViewController;
    }

    to get hold of SKSlideViewController reference.

  4. Add two buttons to MainViewController. Set its title as "Left" and "Right".

    Alt text

  5. Implement an action for touch up inside event for the "Left" button in MainViewController and add the following code to that method.

    Alt text

    - (IBAction)didTappedLeftButton:(id)sender {
        if(self.slideController.isActive){
            [self.slideController revealLeftContainerViewAnimated:YES];
        }else{
            [self.slideController showMainContainerViewAnimated:YES];
        }
    }
  6. Implement an action for touch up inside event for the "Right" button in MainViewController and add the following code to that method.

    Alt text

    - (IBAction)didTappedRightButton:(id)sender {
        if(self.slideController.isActive){
            [self.slideController revealRightContainerViewAnimated:YES];
        }else{
            [self.slideController showMainContainerViewAnimated:YES];
        }
    }
  7. Build and run the code. Now we can tap the "Left" button on the MainViewController to reveal the LeftViewController and "Right" button to reveal the RightViewController.

  8. To initiate communication between MainViewController, LeftViewController and the RightViewController, we could make use of the SKSlideViewController reference. eg. To send a message from LeftViewController to MainViewController

    SAMainViewController *mainController=[self.slideController getMainViewController];
    [mainController someMethod:someDataFromLeftViewController];
3 licenses, starting from From » FREE View Licenses

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.


Or enter your name and Email
No comments have been posted yet.