TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
Sliding Menu for iOS (Top and Bottom menus)
With this library you can create 3 types of sliding menus:
1. Slide menu with top menu only.
2. Slide menu with bottom menu only.
3. Slide menu with both top and bottom menus.
Clone the repository:
$ git clone https://github.com/Juanpe/JPVerticalSlideMenu.git
Drag and drop JPVerticalSlideLib
folder into your project. Add #import "JPVerticalSlideViewController.h"
to all view controllers that need to use it.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIViewController* vcMain = [[UIViewController alloc] init];
vcMain.view.backgroundColor = [UIColor blueColor];
UIViewController * vcTop = [[UIViewController alloc] init];
vcTop.view.backgroundColor = [UIColor redColor];
UIViewController * vcBottom = [[UIViewController alloc] init];
vcBottom.view.backgroundColor = [UIColor greenColor];
JPVerticalSlideViewController* verticalSlideMenu = [JPVerticalSlideViewController verticalSlideMenuWithMainVC:vcMain
andTopVC:vcTop
andBottomVC:vcBottom];
self.window.rootViewController = verticalSlideMenu;
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
You can easily customize slide menu by overriding needed methods, such us:
- (CGFloat) topVCHeight; - (CGFloat) bottomVCHeight; - (CGFloat) panGestureWorkingAreaPercent;
You can open or close top or bottom menus programmatically:
- (void) openTopVC; - (void) openTopVCAnimated:(BOOL)animated; - (void) openBottomVC; - (void) openBottomVCAnimated:(BOOL)animated; - (void) closeTopVC; - (void) closeTopVCAnimated:(BOOL)animated; - (void) closeBottomVC; - (void) closeBottomVCAnimated:(BOOL)animated;
If you want to get menu's open/close callbacks, you must implement protocol named JPVerticalSlideVCDelegate
.
@optional - (void) topVCWillOpen; - (void) topVCDidOpen; - (void) bottomVCWillOpen; - (void) bottomVCDidOpen; - (void) topVCWillClose; - (void) topVCDidClose; - (void) bottomVCWillClose; - (void) bottomVCDidClose;