Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions SECollectionViewFlowLayout.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
AF24726218B32D8D00614655 /* QBAssetsCollectionFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = AF24725518B32D8D00614655 /* QBAssetsCollectionFooterView.m */; };
AF24726318B32D8D00614655 /* QBImagePickerGroupCell.m in Sources */ = {isa = PBXBuildFile; fileRef = AF24725A18B32D8D00614655 /* QBImagePickerGroupCell.m */; };
AF24726418B32D8D00614655 /* QBImagePickerThumbnailView.m in Sources */ = {isa = PBXBuildFile; fileRef = AF24725C18B32D8D00614655 /* QBImagePickerThumbnailView.m */; };
B24127FC191F4B2F00676122 /* QBImagePickerController.strings in Resources */ = {isa = PBXBuildFile; fileRef = B24127F9191F4B2F00676122 /* QBImagePickerController.strings */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -80,6 +81,8 @@
AF24725A18B32D8D00614655 /* QBImagePickerGroupCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = QBImagePickerGroupCell.m; path = PodFiles/QBImagePickerGroupCell.m; sourceTree = "<group>"; };
AF24725B18B32D8D00614655 /* QBImagePickerThumbnailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QBImagePickerThumbnailView.h; path = PodFiles/QBImagePickerThumbnailView.h; sourceTree = "<group>"; };
AF24725C18B32D8D00614655 /* QBImagePickerThumbnailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = QBImagePickerThumbnailView.m; path = PodFiles/QBImagePickerThumbnailView.m; sourceTree = "<group>"; };
B24127FA191F4B2F00676122 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/QBImagePickerController.strings; sourceTree = "<group>"; };
B24127FB191F4B2F00676122 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/QBImagePickerController.strings; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -199,6 +202,7 @@
AF24725A18B32D8D00614655 /* QBImagePickerGroupCell.m */,
AF24725B18B32D8D00614655 /* QBImagePickerThumbnailView.h */,
AF24725C18B32D8D00614655 /* QBImagePickerThumbnailView.m */,
B24127F8191F4B2F00676122 /* Resources */,
);
name = QBImagePickerController;
sourceTree = "<group>";
Expand All @@ -213,6 +217,14 @@
name = PodFiles;
sourceTree = "<group>";
};
B24127F8191F4B2F00676122 /* Resources */ = {
isa = PBXGroup;
children = (
B24127F9191F4B2F00676122 /* QBImagePickerController.strings */,
);
path = Resources;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -273,6 +285,7 @@
knownRegions = (
en,
Base,
ja,
);
mainGroup = AF2471EE18B30BAD00614655;
productRefGroup = AF2471F818B30BAD00614655 /* Products */;
Expand All @@ -293,6 +306,7 @@
AF24721318B30BAD00614655 /* Images.xcassets in Resources */,
AF24720518B30BAD00614655 /* InfoPlist.strings in Resources */,
AF24720E18B30BAD00614655 /* Main.storyboard in Resources */,
B24127FC191F4B2F00676122 /* QBImagePickerController.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -369,6 +383,15 @@
name = InfoPlist.strings;
sourceTree = "<group>";
};
B24127F9191F4B2F00676122 /* QBImagePickerController.strings */ = {
isa = PBXVariantGroup;
children = (
B24127FA191F4B2F00676122 /* en */,
B24127FB191F4B2F00676122 /* ja */,
);
name = QBImagePickerController.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
Expand Down
2 changes: 2 additions & 0 deletions SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ UIKIT_EXTERN ALAssetsFilter * ALAssetsFilterFromQBImagePickerControllerFilterTyp
@property (nonatomic, assign) QBImagePickerControllerFilterType filterType;
@property (nonatomic, assign) BOOL showsCancelButton;
@property (nonatomic, assign) BOOL allowsMultipleSelection;
@property (nonatomic, assign) BOOL allowsSelectRow;
@property (nonatomic, assign) BOOL autoSelectCellsBetweenTouches;
@property (nonatomic, assign) NSUInteger minimumNumberOfSelection;
@property (nonatomic, assign) NSUInteger maximumNumberOfSelection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
QBAssetsCollectionViewController *assetsCollectionViewController = [[QBAssetsCollectionViewController alloc] initWithCollectionViewLayout:[SECollectionViewFlowLayout layoutWithAutoSelectRows:YES panToDeselect:YES autoSelectCellsBetweenTouches:YES]];
QBAssetsCollectionViewController *assetsCollectionViewController = [[QBAssetsCollectionViewController alloc] initWithCollectionViewLayout:[SECollectionViewFlowLayout layoutWithAutoSelectRows:self.allowsSelectRow panToDeselect:YES autoSelectCellsBetweenTouches:self.autoSelectCellsBetweenTouches]];
assetsCollectionViewController.imagePickerController = self;
assetsCollectionViewController.filterType = self.filterType;
assetsCollectionViewController.allowsMultipleSelection = self.allowsMultipleSelection;
Expand Down
16 changes: 3 additions & 13 deletions SECollectionViewFlowLayout/PodFiles/QBImagePickerThumbnailView.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,9 @@ - (void)drawRect:(CGRect)rect
- (void)setAssetsGroup:(ALAssetsGroup *)assetsGroup
{
_assetsGroup = assetsGroup;

// Extract three thumbnail images
NSIndexSet *indexes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, MIN(3, assetsGroup.numberOfAssets))];
NSMutableArray *thumbnailImages = [NSMutableArray array];
[assetsGroup enumerateAssetsAtIndexes:indexes
options:0
usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {
if (result) {
UIImage *thumbnailImage = [UIImage imageWithCGImage:[result thumbnail]];
[thumbnailImages addObject:thumbnailImage];
}
}];
self.thumbnailImages = [thumbnailImages copy];

UIImage* posterImage = [UIImage imageWithCGImage:[assetsGroup posterImage]];
self.thumbnailImages = @[posterImage, posterImage, posterImage];
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
QBImagePickerController.strings
QBImagePickerControllerDemo

Created by Tanaka Katsuma on 2014/01/01.
Copyright (c) 2014年 Katsuma Tanaka. All rights reserved.
*/

"title" = "Photos";

"format_photos_and_videos" = "%ld Photos, %ld Videos";
"format_photos" = "%ld Photos";
"format_videos" = "%ld Videos";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
QBImagePickerController.strings
QBImagePickerControllerDemo

Created by Tanaka Katsuma on 2014/01/01.
Copyright (c) 2014年 Katsuma Tanaka. All rights reserved.
*/

"title" = "アルバム";

"format_photos_and_videos" = "写真%ld枚、ビデオ%ld本";
"format_photos" = "写真%ld枚";
"format_videos" = "ビデオ%ld本";
2 changes: 2 additions & 0 deletions SEQBImagePickerController.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ Pod::Spec.new do |s|
s.license = 'MIT'
s.source = { :git => 'https://github.com/CEWendel/SECollectionViewFlowLayout.git', :tag => '0.0.1' }
s.source_files = 'SECollectionViewFlowLayout/PodFiles/*.{h,m}'
s.resources = 'SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/*.lproj'
s.platform = :ios
s.ios.deployment_target = '6.0'
s.requires_arc = true

end