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. Simplest APIs, enable you to change the style in one line of code.
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
Recently UrbanHooker added round arrow support, I changed a little bit.
Installation
- supports more image resource, such as local UIImage, bundle image name, remote image url.
- also cache remote image into disk.
- just changed almost all of the APIs, and still kept the old APIs working.
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), maybe do this when app starts or when you want it to show a different style, but remember it's global change.
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.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 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:^{
}];
}CHANGELOG
More
- 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.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.




