
Popover Menu is a custom component that you can use to show a pixel perfect popover menu containing a grid of buttons. This component is specially designed to be used with UIBarButtonItem buttons.
The background of the popup is completely drawn using Core Graphics. Thanks to Core Graphics the borders and shadows are pixel perfect and just gorgeous. Since no images are used for the background you can easily modify the look of the popover menu by playing with the values of the constants defined in the class YLPopoverMenu.m.
You can customize the following properties of Popover Menu:
Popover Menu supports landscape and portrait orientations!

1. Create a YLPopoverMenu Object.
NSMutableArray *items = [NSMutableArray array];
[items addObject:[YLMenuItem menuItemWithTitle:@"Home" icon:[UIImage imageNamed:@"hi.png"] pressedIcon:[UIImage imageNamed:@"hpi.png"]]];
[items addObject:[YLMenuItem menuItemWithTitle:@"Messages" icon:[UIImage imageNamed:@"mi.png"] pressedIcon:[UIImage imageNamed:@"mpi.png"]]];
[items addObject:[YLMenuItem menuItemWithTitle:@"Photos" icon:[UIImage imageNamed:@"pi.png"] pressedIcon:[UIImage imageNamed:@"ppi.png"]]];
YLPopoverMenu* menu = [YLPopoverMenu popoverMenuWithItems:items target:self];
[menu setDelegate:self];
[menu presentPopoverFromBarButtonItem:button animated:YES];
2. Implement the delegate method.
- (void)popoverMenu:(YLPopoverMenu *)menu didSelectItem:(int)item {
NSLog(@"You tapped on item %@", [menu buttonTitleAtIndex:item]);
}
3. Or attach individual selectors to menu items.
[YLMenuItem menuItemWithTitle:@"Home" icon:[UIImage imageNamed:@"hi.png"] pressedIcon:[UIImage imageNamed:@"hpi.png" selector:@selector(homeTapped)]
// YLPopoverMenu will call this method on the main thread
- (void)homeTapped {
NSLog(@"You tapped on the Home button.");
}
Great
Very nice and easy to use. Could not be happier.
A very well-made and useful component. I've been using this in many of my apps. Replicates Apple's version of it for iPad very nicely.
Questions & Comments