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

Custom #165

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
89d8b02
Fix crash when the asset in Photo Stream is selected
nek023 Apr 5, 2015
72a7caa
Update podspec
nek023 Apr 5, 2015
5c9c890
Update project
nek023 Apr 5, 2015
49e9f85
Update project settings
nek023 Apr 5, 2015
172a2ba
Import classes from version 3.0.0
nek023 Apr 5, 2015
ede1f96
Add prompt property
nek023 Apr 5, 2015
170bd62
Add showsNumberOfSelectedAssets property
nek023 Apr 5, 2015
ab92d43
Remove showsCancelButton property
nek023 Apr 5, 2015
a98eb2a
Remove isAccessible method
nek023 Apr 5, 2015
26a5fb3
Enable done button in assets view controller
nek023 Apr 5, 2015
a5b4cb5
Change delegate methods (no backward compatibility)
nek023 Apr 5, 2015
9da5d26
Hide selectedAssetURLs property
nek023 Apr 5, 2015
c0992a2
Replace filterType property with mediaType property (no backward comp…
nek023 Apr 5, 2015
0d4071f
Rename groupTypes to assetsGroupTypes (no backward compatibility)
nek023 Apr 5, 2015
7e34451
Update README
nek023 Apr 5, 2015
854e906
Handle device rotation in iOS 7
nek023 Apr 5, 2015
a162732
Restore backward compatibility for delegate methods
nek023 Apr 5, 2015
b881cb3
Restore backward compatibility for filterType property
nek023 Apr 5, 2015
7ce2c3a
Restore backward compatibility for groupTypes property
nek023 Apr 5, 2015
d750e22
Make selectedAssetURLs public and KVO compliant
nek023 Apr 5, 2015
22727e4
Mark showsCancelButton as deprecated
nek023 Apr 5, 2015
da2f9b9
Update README
nek023 Apr 5, 2015
525fcbc
Fix localizations
nek023 Apr 5, 2015
c2deefb
Refactoring
nek023 Apr 5, 2015
5009bff
Update podspec
nek023 Apr 5, 2015
7f34c10
Share schemes
nek023 Apr 5, 2015
3a77f2a
Refactoring
nek023 Apr 5, 2015
f95f861
Handle assets library changes in QBAlbumsViewController
nek023 Apr 5, 2015
8a3b7dd
Handle assets library changes in QBAssetsViewController
nek023 Apr 5, 2015
e7d3397
Bugfix
nek023 Apr 5, 2015
3d2f3a7
Merge branch 'feature/handle-assets-library-changes' into 2.x
nek023 Apr 5, 2015
6a40ac4
Update podspec
nek023 Apr 5, 2015
96cae93
Auto-deselect
nek023 Apr 6, 2015
e49744b
Refactoring
nek023 Apr 6, 2015
786c105
Merge branch 'feature/auto-deselect' into 2.x
nek023 Apr 6, 2015
e49b4d6
Update podspec
nek023 Apr 6, 2015
274c5a5
Refactoring
nek023 Apr 6, 2015
2f62633
Restore +isAccessible method
nek023 Apr 12, 2015
cde378b
Update podspec
nek023 Apr 12, 2015
bad4b57
Bugfix
nek023 May 5, 2015
a4af60d
Update podspec
nek023 May 5, 2015
7f88186
disable right to left languages for album list
Shimi Jul 9, 2015
7f8c572
fixed control's position changes
Shimi Jul 13, 2015
9b8bfdd
revert tools version
Shimi Jul 13, 2015
6b748e2
Merge pull request #73 from Shimi/disable_right_to_left_album_list
nek023 Jul 16, 2015
09cf121
Add Chinese, German, and Spanish localizations
nek023 Jul 16, 2015
4067eea
Update podspec
nek023 Jul 16, 2015
68065bb
- 提供直接进入相册的属性
One9398 Jun 3, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix crash when the asset in Photo Stream is selected
nek023 committed Apr 5, 2015
commit 89d8b02bc7fee7064b2a605c130e5241e4a1c225
47 changes: 35 additions & 12 deletions Pod/Classes/QBImagePickerController.m
Original file line number Diff line number Diff line change
@@ -256,21 +256,44 @@ - (NSArray *)sortAssetsGroups:(NSArray *)assetsGroups typesOrder:(NSArray *)type
- (void)passSelectedAssetsToDelegate
{
// Load assets from URLs
// The asset will be ignored if it is not found
__block NSMutableArray *assets = [NSMutableArray array];
__weak typeof(self) weakSelf = self;

for (NSURL *selectedAssetURL in self.selectedAssetURLs) {
__weak typeof(self) weakSelf = self;
[self.assetsLibrary assetForURL:selectedAssetURL
void (^checkNumberOfAssets)(void) = ^{
if (assets.count == weakSelf.selectedAssetURLs.count) {
// Delegate
if (self.delegate && [self.delegate respondsToSelector:@selector(qb_imagePickerController:didSelectAssets:)]) {
[self.delegate qb_imagePickerController:self didSelectAssets:[assets copy]];
}
}
};

for (NSURL *assetURL in self.selectedAssetURLs) {
[self.assetsLibrary assetForURL:assetURL
resultBlock:^(ALAsset *asset) {
// Add asset
[assets addObject:asset];

// Check if the loading finished
if (assets.count == weakSelf.selectedAssetURLs.count) {
// Delegate
if (self.delegate && [self.delegate respondsToSelector:@selector(qb_imagePickerController:didSelectAssets:)]) {
[self.delegate qb_imagePickerController:self didSelectAssets:[assets copy]];
}
if (asset) {
// Add asset
[assets addObject:asset];

// Check if the loading finished
checkNumberOfAssets();
} else {
[self.assetsLibrary enumerateGroupsWithTypes:ALAssetsGroupPhotoStream usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
[group enumerateAssetsWithOptions:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {
if ([result.defaultRepresentation.url isEqual:assetURL]) {
// Add asset
[assets addObject:result];

// Check if the loading finished
checkNumberOfAssets();

*stop = YES;
}
}];
} failureBlock:^(NSError *error) {
NSLog(@"Error: %@", [error localizedDescription]);
}];
}
} failureBlock:^(NSError *error) {
NSLog(@"Error: %@", [error localizedDescription]);