iphone - Popover segue option in storyboard segue style field is not showing -
i want choose storyboard segue style popover dont see in segue style field.
story board action segue presents push, modal , custom.
have uibarbuttonitem want choose popover storyboard segue.
any suggestions please.
go simulated metrics , should find it. here image of is. note popover available in ipad not in iphone through simulator.
edit:
here sample code using button , action method create popover:
you need declare popovercontroller property:
@property (nonatomic, strong) uipopovercontroller* buttonpopovercontroller;
then button action can this:
- (void) buttontapped:(uibutton*) sender { contentviewcontroller* contentvc = [[contentviewcontroller alloc] init]; self.buttonpopovercontroller = [[uipopovercontroller alloc] initwithcontentviewcontroller:contentvc]; self.buttonpopovercontroller.delegate = self; //only required if using delegate methods [self.buttonpopovercontroller presentpopoverfromrect:sender.frame inview:self.view permittedarrowdirections:uipopoverarrowdirectionany animated:yes]; }
the contentviewcontroller whichever view controller intending segue to. if configured using storyboard scene, may want when create it:
uistoryboard *storyboard = self.storyboard; contentviewcontroller* contentvc = [storyboard instantiateviewcontrollerwithidentifier:@"contentviewcontroller"];
you can set storyboard identifier using identity inspector when have relevant view controller selected in storyboard.
Comments
Post a Comment