Skip to content
This repository was archived by the owner on Apr 15, 2019. It is now read-only.

Commit fa093cc

Browse files
committed
Restore iOS < 8 compatibility
1 parent a2a590f commit fa093cc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

FSImageViewer/FSImageViewerViewController.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,10 @@ - (void)share:(id)sender {
216216
NSAssert(currentImage.image, @"The image must be loaded to share.");
217217
if (currentImage.image) {
218218
UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:@[currentImage.image] applicationActivities:_applicationActivities];
219-
if(!controller.popoverPresentationController.barButtonItem){
220-
controller.popoverPresentationController.barButtonItem = shareButton;
219+
if([controller respondsToSelector:@selector(popoverPresentationController)]) {
220+
if (!controller.popoverPresentationController.barButtonItem) {
221+
controller.popoverPresentationController.barButtonItem = shareButton;
222+
}
221223
}
222224
[self presentViewController:controller animated:YES completion:nil];
223225
}

0 commit comments

Comments
 (0)