slider menu

Posted by Albert 2809Day 15Hour 47Min 2Sec ago [2017-08-10]

Why to use a library everytime?

Slider Menu (Drawer)
Slider Menu (Drawer)

Let’s create our own Slide Menu (Drawer) in Swift 3.

1. Create New Project in Xcode 8 with Swift Language

2. Design the Menu in UIViewController

Menu UIViewController
Menu UIViewController

Declaration of Variables and Protocols (Delegate) :

Following method is for updating the Items in the Menu :

Following method is for click event and animation :


3. Now we will create a Base UIViewController to use anywhere in the project which control the delegate of menu.

First we will create this 3 lines Drawer Icon via Code

Preview_Slider_Drawer_ICon

Delegate (Protocol) method call :

To open a view controller by identifier :

Set the Restoration Identifier and Storyboard Identifier. If current view is open then we will not open it once again for that we have to check via Restoration Identifier.

4. Now We will assign this drawer to any of the UIViewController

We have to use only one method to add drawer (slide menu) self.addSlideMenuButton()


Source Code is available at the Github AKSwiftSlideMenu

GitHub AKSwiftSlideMenu Releases
GitHub AKSwiftSlideMenu Releases

You can download for both versions Swift 2 or Swift 3. From Releases Tab at GitHub AKSwiftSlideMenu .

I have uploaded a video for easy way to integrate AKSwiftSlideMenu in your project :

Check other blog posts about Swift


http://ashishkakkad.com/2015/09/create-your-own-slider-menu-drawer-in-swift/




LIST

Copyright © 2014 visionboy.me All Right Reserved.