Could anyone please tell me what the rect and view should be? I do not understand what I shall pass to the selector. An example would be great!
- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated
I use this pretty often. Let’s say you want to tap on an image and present a popover with information about it. Assuming you have a gesture recognizer with the selector method
(handleImageTap:)on your image, here would be an example code to make that happen:So basically,
viewwill be self.view becuase you are displaying it from the current view controller. Therectis just whatever rect you want the popover to display from. In this case, it is set up to be displayed from the frame of an image. I hope this helps you. If something is still confusing, I’ll be happy to try and clear it up