TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Custom |
ReleasedLast Release | Apr 2015 |
Maintained by Shawn Irvin.
Depends on: | |
VBFPopFlatButton | ~> 0.0.6 |
TDBadgedCell | ~> 3.0 |
pop | ~> 1.0.6 |
FXBlurView | ~> 1.6.3 |
This is a floating menu style navigation inspired by MailChimp's iOS menu navigation control. It utilizes the VBFPopFlatButton and TDBadgedCell frameworks. See a demo below:
The best way to use this control is to use CocoaPods. Insert the following in your podfile:
pod 'SIFloatingMenuViewController'
For more information on using CocoaPods, visit cocoapods.org. If this is your first time using CocoaPods, I also recommend watching the video here.
Once you've added the pod to your project, subclass the SIFloatingMenuViewController
and add your version of the following code to the viewDidLoad
method.
//Create the menu items
SIMenuItem *menuItem1 = [SIMenuItem menuItemWithTitle:@"View 1" image:[UIImage imageNamed:@"Image1"]];
SIMenuItem *menuItem2 = [SIMenuItem menuItemWithTitle:@"View 2" image:[UIImage imageNamed:@"Image2"]];
SIMenuItem *menuItem3 = [SIMenuItem menuItemWithTitle:@"View 3" image:[UIImage imageNamed:@"Image3"]];
//Add the menu items
[self.menuTableView setMenuItems:@[menuItem1, menuItem2, menuItem3]];
//Initialize the UIViewControllers you want to be displayed when a menu item is tapped
UIViewController *vc1 = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"View 1"];
UIViewController *vc2 = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"View 2"];
UIViewController *vc3 = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"View 3"];
//Set them on the SIFloatingMenuViewController.
self.viewControllers = @[vc1, vc2, vc3];
Below are just some of the customizations you can make to the control. There are plenty more including changing where the menu button is displayed on screen (Bottom Left, Bottom Middle, or Bottom Right) and how the menu button is animated onto screen.
self.animationBounciness = 0;
self.animationSpeed = 10;
self.menuButtonBorderMargin = 20;
self.menuButtonAdditionalBottomMargin = 10;
self.menuButtonAdditionalSideMargin = 5;
self.menuButtonSize = CGSizeMake(60, 60);
self.dimmedViewAlpha = 0.25;
self.backgroundTapDismissesMenu = NO;