Coder Social home page Coder Social logo

depthsky / ftpopovermenu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liufengting/ftpopovermenu

0.0 2.0 0.0 3.14 MB

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

License: MIT License

Objective-C 97.91% Ruby 2.09%

ftpopovermenu's Introduction

FTPopOverMenu

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

FTPopOverMenu is 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.

ftpopovermenu's People

Contributors

liufengting avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.