ou will get Final Output:

  • iOS Using Sliding View Controller
  • iOS Using Sliding View Controller
  • iOS Using Sliding View Controller
  • iOS Using Sliding View Controller

Following are the steps that give you a brief introduction to use sliding functionality for view controller for interactive application.

Step 1 App Flow

This app consists of three screens:

  1. Home
  2. Settings
  3. Menu

Tapping the Click me! Button anchors the top view to the right to show the menu. From there, you can tap on Home or Settings to reset the top view to the middle while changing the top view controller. This example is also a good representation of the defaults used with ECSlidingViewController. This was made almost entirely in Storyboards except for the unwind segue. It may be difficult to see how the view controllers are related.

Step 2 Design UI & Set Parameters

Select the sliding view controller in the Storyboard and click on the identity inspector.

You should see the following:

The sliding view controller needs to know which view controllers to load initially when it is loaded. This is done in the User Defined Runtime Attributes. We set the topViewControllerStoryboardId to the string value HomeNavigationController. This will set the sliding view controller’s topViewController to a view controller in Storyboard with the Storyboard ID HomeNavigationController.

The same thing is done to set the underLeftViewController to the MenuViewController. You should be able to find the navigation controller with the Storyboard ID HomeNavigationController and the table view controller with the Storyboard ID MenuViewController.

Step 3 Download ThirdParty from GitHub

Both the Home and Settings view controllers have a menu button which causes the top view to slide to the right and show the menu. This is accomplished with an unwind segue. Make this connection by CTRL-dragging from the menu button down to the green exit symbol.

Select unwindToMenuViewController: To unwind to the menu.

The unwind segue will detect that the current underLeftViewController instance is of the same type as the destination of the unwind segue. This will trigger a anchorTopViewToRightAnimated: on the sliding view controller. If the current under right view controller was the same type as the destination, then it will trigger an anchor to the left side instead.

If you got any query related to using slider view controller in iOS comment them below. We will try to solve them out.

Leave a Reply