This is written in objective c and uses "Block" instead of delegates of UIPopoverController(<iOS8) and UIPopoverPresentationController(>iOS8).
[compatiblePopoverController setShouldDismissHandler:^
{
return YES;
}];
This line of code replaces the delegate code of UIPopoverController :
- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController
and delegate code of UIPopoverPresentationController:
- (BOOL)popoverPresentationControllerShouldDismissPopover:(UIPopoverPresentationController *)popoverPresentationController
Similarly all the delegate methods replace with Block of code for better use in the app.
Code samples are provided in the demo project.
compatiblePopoverController = [[PRCompatiblePopoverController alloc] initWithContentViewController:sampleTableViewConroller ofPreferedSize:CGSizeMake(150.0, 200.0)];
[compatiblePopoverController setSourceView:sender];
[compatiblePopoverController setSourceRect:sender.bounds];
[compatiblePopoverController setPermittedArrowDirections:UIPopoverArrowDirectionAny];
[compatiblePopoverController presentPopoverViewOnController:self
animated:YES completion:NULL];
"PRCompatiblePopover" is licensed under the MIT License. See LICENSE for details.