diff --git a/SECollectionViewFlowLayout.xcodeproj/project.pbxproj b/SECollectionViewFlowLayout.xcodeproj/project.pbxproj index ddc2120..431f813 100644 --- a/SECollectionViewFlowLayout.xcodeproj/project.pbxproj +++ b/SECollectionViewFlowLayout.xcodeproj/project.pbxproj @@ -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 */ @@ -80,6 +81,8 @@ AF24725A18B32D8D00614655 /* QBImagePickerGroupCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = QBImagePickerGroupCell.m; path = PodFiles/QBImagePickerGroupCell.m; sourceTree = ""; }; AF24725B18B32D8D00614655 /* QBImagePickerThumbnailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QBImagePickerThumbnailView.h; path = PodFiles/QBImagePickerThumbnailView.h; sourceTree = ""; }; AF24725C18B32D8D00614655 /* QBImagePickerThumbnailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = QBImagePickerThumbnailView.m; path = PodFiles/QBImagePickerThumbnailView.m; sourceTree = ""; }; + B24127FA191F4B2F00676122 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/QBImagePickerController.strings; sourceTree = ""; }; + B24127FB191F4B2F00676122 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/QBImagePickerController.strings; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -199,6 +202,7 @@ AF24725A18B32D8D00614655 /* QBImagePickerGroupCell.m */, AF24725B18B32D8D00614655 /* QBImagePickerThumbnailView.h */, AF24725C18B32D8D00614655 /* QBImagePickerThumbnailView.m */, + B24127F8191F4B2F00676122 /* Resources */, ); name = QBImagePickerController; sourceTree = ""; @@ -213,6 +217,14 @@ name = PodFiles; sourceTree = ""; }; + B24127F8191F4B2F00676122 /* Resources */ = { + isa = PBXGroup; + children = ( + B24127F9191F4B2F00676122 /* QBImagePickerController.strings */, + ); + path = Resources; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -273,6 +285,7 @@ knownRegions = ( en, Base, + ja, ); mainGroup = AF2471EE18B30BAD00614655; productRefGroup = AF2471F818B30BAD00614655 /* Products */; @@ -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; }; @@ -369,6 +383,15 @@ name = InfoPlist.strings; sourceTree = ""; }; + B24127F9191F4B2F00676122 /* QBImagePickerController.strings */ = { + isa = PBXVariantGroup; + children = ( + B24127FA191F4B2F00676122 /* en */, + B24127FB191F4B2F00676122 /* ja */, + ); + name = QBImagePickerController.strings; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ diff --git a/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h b/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h index a35539f..bf14161 100644 --- a/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h +++ b/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.h @@ -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; diff --git a/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m b/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m index 4d80b8a..f421fae 100644 --- a/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m +++ b/SECollectionViewFlowLayout/PodFiles/QBImagePickerController.m @@ -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; diff --git a/SECollectionViewFlowLayout/PodFiles/QBImagePickerThumbnailView.m b/SECollectionViewFlowLayout/PodFiles/QBImagePickerThumbnailView.m index aa525cd..270f9e9 100644 --- a/SECollectionViewFlowLayout/PodFiles/QBImagePickerThumbnailView.m +++ b/SECollectionViewFlowLayout/PodFiles/QBImagePickerThumbnailView.m @@ -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 diff --git a/SECollectionViewFlowLayout/en.lproj/InfoPlist.strings b/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/en.lproj/InfoPlist.strings similarity index 100% rename from SECollectionViewFlowLayout/en.lproj/InfoPlist.strings rename to SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/en.lproj/InfoPlist.strings diff --git a/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/en.lproj/QBImagePickerController.strings b/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/en.lproj/QBImagePickerController.strings new file mode 100644 index 0000000..0ae19c8 --- /dev/null +++ b/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/en.lproj/QBImagePickerController.strings @@ -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"; diff --git a/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/ja.lproj/InfoPlist.strings b/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/ja.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/ja.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/ja.lproj/QBImagePickerController.strings b/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/ja.lproj/QBImagePickerController.strings new file mode 100644 index 0000000..15afa95 --- /dev/null +++ b/SECollectionViewFlowLayout/SECollectionViewFlowLayout.bundle/ja.lproj/QBImagePickerController.strings @@ -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本"; diff --git a/SEQBImagePickerController.podspec b/SEQBImagePickerController.podspec index da09da5..a210411 100644 --- a/SEQBImagePickerController.podspec +++ b/SEQBImagePickerController.podspec @@ -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