|
3 | 3 | #import "WPMediaCaptureCollectionViewCell.h" |
4 | 4 | #import "WPMediaPickerViewController.h" |
5 | 5 | #import "WPMediaGroupPickerViewController.h" |
6 | | -#import "WPALAssetDataSource.h" |
7 | 6 |
|
8 | 7 | @import MobileCoreServices; |
9 | 8 | @import AVFoundation; |
@@ -274,22 +273,21 @@ - (void)refreshData |
274 | 273 | strongSelf.collectionView.allowsSelection = YES; |
275 | 274 | strongSelf.collectionView.scrollEnabled = YES; |
276 | 275 | [strongSelf.collectionView reloadData]; |
277 | | - if ([error.domain isEqualToString:ALAssetsLibraryErrorDomain]) { |
278 | | - if (error.code == ALAssetsLibraryAccessUserDeniedError || error.code == ALAssetsLibraryAccessGloballyDeniedError) { |
279 | | - NSString *otherButtonTitle = nil; |
280 | | - if ([[self class] isiOS8OrAbove]) { |
281 | | - otherButtonTitle = NSLocalizedString(@"Open Settings", @"Go to the settings app"); |
282 | | - } |
283 | | - UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Media Library", @"Title for alert when access to the media library is not granted by the user") |
284 | | - message:NSLocalizedString(@"This app needs permission to access your device media library in order to add photos and/or video to your posts. Please change the privacy settings if you wish to allow this.", @"Explaining to the user why the app needs access to the device media library.") |
285 | | - delegate:self |
286 | | - cancelButtonTitle:NSLocalizedString(@"OK", "") |
287 | | - otherButtonTitles:otherButtonTitle,nil]; |
288 | | - alertView.tag = WPMediaCollectionAlertMediaLibraryPermissionsNeeded; |
289 | | - alertView.delegate = strongSelf; |
290 | | - [alertView show]; |
291 | | - return; |
| 276 | + if (error.domain == WPMediaPickerErrorDomain && |
| 277 | + error.code == WPMediaErrorCodePermissionsFailed) { |
| 278 | + NSString *otherButtonTitle = nil; |
| 279 | + if ([[self class] isiOS8OrAbove]) { |
| 280 | + otherButtonTitle = NSLocalizedString(@"Open Settings", @"Go to the settings app"); |
292 | 281 | } |
| 282 | + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Media Library", @"Title for alert when access to the media library is not granted by the user") |
| 283 | + message:NSLocalizedString(@"This app needs permission to access your device media library in order to add photos and/or video to your posts. Please change the privacy settings if you wish to allow this.", @"Explaining to the user why the app needs access to the device media library.") |
| 284 | + delegate:self |
| 285 | + cancelButtonTitle:NSLocalizedString(@"OK", "") |
| 286 | + otherButtonTitles:otherButtonTitle,nil]; |
| 287 | + alertView.tag = WPMediaCollectionAlertMediaLibraryPermissionsNeeded; |
| 288 | + alertView.delegate = strongSelf; |
| 289 | + [alertView show]; |
| 290 | + return; |
293 | 291 | } |
294 | 292 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Media Library", @"Title for alert when a generic error happened when loading media") |
295 | 293 | message:NSLocalizedString(@"There was a problem when trying to access your media. Please try again later.", @"Explaining to the user there was an generic error accesing media.") |
|
0 commit comments