alvises / FPPopover

FPPopover provides an alternative to the native iOS UIPopoverController, adding support for iPhone and additional opportunities to customize the look and feel of the popovers.
http://www.poeticoding.com/fppopover-a-customizable-uipopovercontroller-for-iphone-and-ipad/
Other
901 stars 250 forks source link

popover from tabBarItem? #12

Closed pcompassion closed 11 years ago

pcompassion commented 12 years ago

I glanced over the code and it looks like adding popover from navigationBar/toolBar/tabBar isn't readily available. (since they are not Views)

I'm not sure if "new issue" is the right place to ask this.

fotisp commented 12 years ago

This is from a stackoverflow answer I can't find right now, it should work with a navigation button

UIBarButtonItem *buttonItem = sender;
UIView* btnView = [buttonItem valueForKey:@"view"];
tarekjradi commented 12 years ago

fotakis thats right. Thanks for this.

this is my code :

MypopOverViewController = [[UIViewController alloc] init];

FPPopoverController *popover = [[FPPopoverController alloc] initWithViewController:MypopOverViewController];

UIView* btnView = [sender valueForKey:@"view"];

//sender is the UIButton view
[popover presentPopoverFromView:btnView];

... and works fine!

alvises commented 11 years ago

Yes, doing the same thing.
Thanks @jradi3 .

Closing the issue