• Stars
    star
    1,035
  • Rank 44,530 (Top 0.9 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

FTPopOverMenu is a pop over menu for iOS which is maybe the easiest one to use. Supports both portrait and landscape. It can show from any UIView, any UIBarButtonItem and any CGRect.

FTPopOverMenu

FTPopOverMenu

Twitter GitHub license Version Codebeat badge Download CocoaPods CocoaPods CI Status GitHub stars Gitter

FTPopOverMenu is a pop over menu for iOS which is maybe the easiest one to use, supports both portrait and landscape. It can show from any UIView, any UIBarButtonItem and any CGRect. Simplest APIs, enable you to change the style in one line of code.

menu array supports following context:

  • image name (NSString, only main bundle),
  • image (UIImage),
  • image remote URL string (NSString),
  • image remote URL (NSURL),
  • model (FTPopOverMenuModel, select state support)

⚠️ Big API Change from 1.3.6 to 2.0.0 (See CHANGELOG for more info)

  • supports separated configuration.
  • change 'tintColor' to 'backgroundColor'

About Swift Version

FTPopOverMenu_Swift is now published. Take a look at it now. The swift version has same APIs with this OC version.

ScreenShots

screenshots

Recently UrbanHooker added round arrow support, I changed a little bit.

screenshots

Installation

Manually

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

CocoaPods

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

pod 'FTPopOverMenu'

Usage

Customize

Do any of the following settings to set the style (Only set the ones you want to change) before showing.

    FTPopOverMenuConfiguration *configuration = [FTPopOverMenuConfiguration defaultConfiguration];
    configuration.menuRowHeight = ...
    configuration.menuWidth = ...
    configuration.textColor = ...
    configuration.textFont = ...
    configuration.tintColor = ...
    configuration.borderColor = ...
    configuration.borderWidth = ...
    configuration.textAlignment = ...
    configuration.ignoreImageOriginalColor = ...;// set 'ignoreImageOriginalColor' to YES, images color will be same as textColor
    configuration.allowRoundedArrow = ...// Default is 'NO', if sets to 'YES', the arrow will be drawn with round corner.
    configuration.separatorColor = ...
    configuration.shadowColor = ... // Default is black
    configuration.shadowOpacity = ... // Default is 0 - choose anything between 0 to 1 to show actual shadow, e.g. 0.2
    configuration.shadowRadius = ... // Default is 5
    configuration.shadowOffsetX = ...
    configuration.shadowOffsetY = ...

setTintColor, default is gray color. deprecated after 1.2.0

    [FTPopOverMenu setTintColor:[UIColor redColor]];

setTextColor, default is white color. deprecated after 1.2.0

    [FTPopOverMenu setTextColor:[UIColor blackColor]];

setPreferedWidth, default is 120, should not be less than 50. deprecated after 1.2.0

    [FTPopOverMenu setPreferedWidth:200];

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 SenderView, Menu With Images, custom configuration.

    [FTPopOverMenu showForSender:sender
                        withMenu:@[@"MenuOne",@"MenuTwo",@"MenuThr"]
                  imageNameArray:@[@"setting_icon",@"setting_icon",@"setting_icon"]
                   configuration:customConfiguration
                       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 SenderFrame/NavigationItem, Menu With Images, custom configuration.

    [FTPopOverMenu showFromSenderFrame:CGRectMake(self.view.frame.size.width - 40, 20, 40, 40)
                              withMenu:@[@"123",@"234",@"345"]
                        imageNameArray:@[@"setting_icon",@"setting_icon",@"setting_icon"]
	                     configuration:customConfiguration
                             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, also supports custom configuration.
-(void)onNavButtonTapped:(UIBarButtonItem *)sender event:(UIEvent *)event
{

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

CHANGELOG

CHANGELOG

More

  • Logo Designed by @Tobaloidee
  • Images in the demo from https://www.iconfinder.com/iconsets/pokemon-go.
  • If you like it, or maybe wanna use it in your own projects, please give me a star.
  • Looking for another way of doing this? Take a look at my another FTPopMenu at here. It was another way of showing pop over menus, which is wrapped from UIPopoverViewController, and more genetic and more good-looking. Feel free to try it.

License

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

More Repositories

1

FTPopOverMenu_Swift

FTPopOverMenu_Swift, swift version of FTPopOverMenu. FTPopOverMenu is a pop over menu for iOS which is maybe the easiest one to use. Supports both portrait and landscape. It can show from any UIView, any UIBarButtonItem and any CGRect.
Swift
430
star
2

FTIndicator

A light wight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes support.
Objective-C
297
star
3

FTFoldingTableView

FTFoldingTableView. Folding cells with simple delegates, and change UI looks in a few lines.
Objective-C
130
star
4

FTImageViewer

FTImageViewer can preview images with just one lines of code with Swift. Also FTImageViewGrid has make showing images in grid much easier.
Swift
125
star
5

FTChatMessage

FTChatMessage, a chat message UI framework written in swift. Not quite finished.
Swift
63
star
6

FTChatMessageDemoProject

FTChatMessageDemoProject, a chat message UI framework written in swift. Not quite finished.
Swift
62
star
7

FTPopMenu

FTPopMenu
Objective-C
25
star
8

FTPickerView

FTPickerView. A simple UIPickerView/UIDatePicker wrapper.
Objective-C
17
star
9

FTImageSize

FTImageSize. Get image size from remote image url synchronously, without downloading it.
Swift
15
star
10

FTPinterest

FTPinterest is just a demo I wrote.
Swift
7
star
11

liufengting.github.io

Repo for My Blog.
HTML
5
star
12

FTPageController

FTPageController
Swift
3
star
13

FTFoldableTableView

FTFoldableTableView
Objective-C
3
star
14

FTPullToRefresh

FTPullToRefresh. Wait for it.
Objective-C
3
star
15

FTZoomTransition

FTZoomTransition
Swift
2
star
16

FTProgressView

FTProgressView
Swift
2
star
17

FTWaterFallLayout

FTWaterFallLayout
Swift
2
star
18

FTContainerController

FTContainerController
Objective-C
2
star
19

FTInteractiveTransition

FTInteractiveTransition
Objective-C
1
star
20

FTProgressHUD

FTProgressHUD
Swift
1
star