[ios] Only set preferred action on iOS 9+

Fixed a crash on iOS 8 when presenting the Add Offline Pack dialog.

Fixes #4305.
This commit is contained in:
Minh Nguyễn
2016-03-14 12:08:21 -07:00
committed by Minh Nguyễn
parent e04fea8409
commit 6f86bee283

View File

@@ -100,7 +100,9 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac
}];
}];
[alertController addAction:downloadAction];
alertController.preferredAction = downloadAction;
if ([alertController respondsToSelector:@selector(setPreferredAction:)]) {
alertController.preferredAction = downloadAction;
}
[self presentViewController:alertController animated:YES completion:nil];
}