Skip to content

GitWatcher/FTPopOverMenu

 
 

Repository files navigation

FTPopOverMenu

Twitter GitHub license Version Platform Download CocoaPods CocoaPods CI Status GitHub stars Gitter

A pop over menu for iOS which is maybe the easiest one to use. Now supports both portrait and landscape.

ScreenShots

##Installation

###Manually

  • clone this repo.
  • Simply drop the '/FTPopOverMenu' folder into your project.
  • import 'FTPopOverMenu.h'
  • Enjoy!

###Cocoapods FTPopOverMenu is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'FTPopOverMenu'

Useage

setTintColor

    [FTPopOverMenu setTintColor:[UIColor redColor]];

From SenderView, Menu Without Images

    [FTPopOverMenu showForSender:sender
                        withMenu:@[@"MenuOne",@"MenuTwo",@"MenuThr"]
                       doneBlock:^(NSInteger selectedIndex) {
                           
                       } dismissBlock:^{
                          
                       }];

From SenderView, Menu With Images

    [FTPopOverMenu showForSender:sender
                        withMenu:@[@"MenuOne",@"MenuTwo",@"MenuThr"]
                  imageNameArray:@[@"setting_icon",@"setting_icon",@"setting_icon"]
                       doneBlock:^(NSInteger selectedIndex) {
                           
                       } dismissBlock:^{
                          
                       }];

From SenderFrame/NavigationItem, Menu Without Images

    [FTPopOverMenu showFromSenderFrame:CGRectMake(self.view.frame.size.width - 40, 20, 40, 40)
                              withMenu:@[@"123",@"234",@"345"]
                             doneBlock:^(NSInteger selectedIndex) {
                                 
                             } dismissBlock:^{
                                 
                             }];

From SenderFrame/NavigationItem, Menu With Images

    [FTPopOverMenu showFromSenderFrame:CGRectMake(self.view.frame.size.width - 40, 20, 40, 40)
                              withMenu:@[@"123",@"234",@"345"]
                        imageNameArray:@[@"setting_icon",@"setting_icon",@"setting_icon"]
                             doneBlock:^(NSInteger selectedIndex) {
                                 
                             } dismissBlock:^{
                                 
                             }];

From barButtonItems

  • First: add action with event to you barButtonItems
    [self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UIBarButtonItemStyleDone target:self action:@selector(onNavButtonTapped:event:)]];
  • Second: implement the action
-(void)onNavButtonTapped:(UIBarButtonItem *)sender event:(UIEvent *)event
{

    [FTPopOverMenu showFromEvent:event
                        withMenu:@[@"123",@"234",@"345"]
                  imageNameArray:@[@"setting_icon",@"setting_icon",@"setting_icon"]
                       doneBlock:^(NSInteger selectedIndex) {
                           
                       } dismissBlock:^{
                           
                       }];
}

More

Look for another way of doing this? See Here

License

FTPopOverMenu is available under the MIT license. See the LICENSE file for more info.

About

A pop over menu which is maybe the easiest to use.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 98.0%
  • Ruby 2.0%