Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git://github.com/alondon/AssetPicker into al…

…ondon-master

Conflicts:
	DIYAssetPicker/DIYAssetPickerController.m
  • Loading branch information...
commit 1fdf68323c6df1b60111e9d623bd1e6fe572ebb0 2 parents 7867a82 + fe4902c
@dongle authored
View
1  DIYAssetPicker/DIYAssetPickerController.h
@@ -50,5 +50,6 @@ NSString *const DIYAssetPickerThumbnail;
#pragma mark - Options
@property (nonatomic, assign) DIYAssetPickerControllerAssetType assetType;
+@property (nonatomic, assign) ALAssetsGroupType groupType;
@end
View
16 DIYAssetPicker/DIYAssetPickerController.m
@@ -31,6 +31,7 @@ - (id)init
{
if (self = [super init]) {
_assetType = DIYAssetPickerPhotoVideo;
+ _groupType = ALAssetsGroupSavedPhotos;
}
return self;
@@ -258,6 +259,13 @@ - (void)setAssetType:(DIYAssetPickerControllerAssetType)assetType
[self.assetsTable reloadData];
}
+- (void)setGroupType:(ALAssetsGroupType)groupType
+{
+ self->_groupType = groupType;
+ [self getAssetsArray];
+ [self.assetsTable reloadData];
+}
+
#pragma mark - Utility
- (void)getAssetsArray
@@ -265,7 +273,7 @@ - (void)getAssetsArray
[self.assetsArray removeAllObjects];
[self.assetsLibrary
- enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos
+ enumerateGroupsWithTypes:self.groupType
usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
if (self.assetType == DIYAssetPickerPhoto) {
[group setAssetsFilter:[ALAssetsFilter allPhotos]];
@@ -292,10 +300,10 @@ - (void)getAssetsArray
NSInteger code = [error code];
if (code == ALAssetsLibraryAccessUserDeniedError || code == ALAssetsLibraryAccessGloballyDeniedError) {
UIAlertView *alert = [[UIAlertView alloc]
- initWithTitle:@"Error"
- message:@"Can't access photos - please allow access via the settings app. On iOS 5, enable 'location data' for this app. On iOS 6, go to privacy and enable photo access for this app."
+ initWithTitle:NSLocalizedString(@"Privacy Error", @"Privacy error title.")
+ message:NSLocalizedString(@"Please go to the Settings app > Privacy > Photos and enable access for this app in order to choose photos from the device library.", @"Privacy error message.")
delegate:nil
- cancelButtonTitle:@"OK"
+ cancelButtonTitle:NSLocalizedString(@"OK", @"OK button title.")
otherButtonTitles:nil];
[alert show];
}
Please sign in to comment.
Something went wrong with that request. Please try again.