AKSideMenu
AKSideMenu is a double side menu library with Parallax effect.
Example Project
See the contained examples to get a sample of how AKSideMenu
can easily be integrated in your project.
Build the examples from the AKSideMenuExamples
directory.
Installation
CocoaPods.
To install, add the following line to your Podfile:
Carthage.
To install, add the following line to your Cartfile:
Easy to use
Simple implementation
In your AppDelegate, add the code below.
Storyboards Example
- Create a subclass of
AKSideMenu
. In this example we call itRootViewController
. - In the Storyboard designate the root view's owner as
RootViewController
. - Add more view controllers to your Storyboard, and give them identifiers "leftMenuViewController", "rightMenuViewController" and "contentViewController". Note that in the new XCode the identifier is called "Storyboard ID" and can be found in the Identity inspector.
- Add a method
awakeFromNib
toRootViewController.swift
with the following code:
Here is an example of a delegate implementation. Please adapt the code to your context.
Present the menu view controller:
or
Switch content view controllers:
Properties
The animation duration. Defaults to 0.35.
The content background image. Defaults to white.
Enables panGesture detection. Defaults to True.
Enables panGesture detection from the edge. Defaults to True.
The minimum pan gesture amount to open the side menu. Defaults to 60.0.
Enables interactive pop gesture recognizer. Defaults to True.
TODO. Defaults to True.
TODO. Defaults to False.
TODO. Defaults to True.
TODO. Defaults to False.
TODO. Defaults to CGSizeZero.
TODO. Defaults to 0.4.
TODO. Defaults to 8.0.
TODO. Defaults to 0.7.
TODO. Defaults to 30.0.
TODO. Defaults to 30.0.
TODO. Defaults to -15.
TODO. Defaults to 15.
TODO. Defaults to -25.
TODO. Defaults to 25.
TODO. Defaults to nil.
TODO. Defaults to True.
TODO. Defaults to True.
Preferred UIStatusBarStyle when the menu is visible. Defaults to UIStatusBarStyle.default.
Sets StatusBar hidden or not when the menu is visible. Defaults to False.
Sets the transform scale amount applied to the background imageview. Defaults to 1.7.
Sets the width of the pan gesture zone should be recognized. Defaults to 20.0.
Enable or disable left pan gesture recognition. Defaults to True.
Enable or disable right pan gesture recognition. Defaults to True.
Collaboration
I tried to build an easy way to use API, while being flexible enough for multiple variations, but I'm sure there are ways of improving and adding more features, so feel free to collaborate with ideas, issues and/or pull requests.
ARC
AKSideMenu needs ARC.