Skip to content

Commit

Permalink
fix #101, #102
Browse files Browse the repository at this point in the history
  • Loading branch information
longitachi committed Sep 29, 2017
1 parent 862219f commit e50781c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion PhotoBrowser/ZLPhotoActionSheet.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ NS_ASSUME_NONNULL_BEGIN
@param photos 已选择的uiimage照片数组
@param assets 已选择的phasset照片数组
@param index 点击的照片索引
@param isOriginal 是否为原图
*/
- (void)previewSelectedPhotos:(NSArray<UIImage *> *)photos assets:(NSArray<PHAsset *> *)assets index:(NSInteger)index;
- (void)previewSelectedPhotos:(NSArray<UIImage *> *)photos assets:(NSArray<PHAsset *> *)assets index:(NSInteger)index isOriginal:(BOOL)isOriginal;


/**
Expand Down
3 changes: 2 additions & 1 deletion PhotoBrowser/ZLPhotoActionSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,9 @@ - (void)showPreview:(BOOL)preview animate:(BOOL)animate
}
}

- (void)previewSelectedPhotos:(NSArray<UIImage *> *)photos assets:(NSArray<PHAsset *> *)assets index:(NSInteger)index
- (void)previewSelectedPhotos:(NSArray<UIImage *> *)photos assets:(NSArray<PHAsset *> *)assets index:(NSInteger)index isOriginal:(BOOL)isOriginal
{
self.isSelectOriginalPhoto = isOriginal;
self.arrSelectedAssets = [NSMutableArray arrayWithArray:assets];
ZLShowBigImgViewController *svc = [self pushBigImageToPreview:photos index:index];
weakify(self);
Expand Down
4 changes: 3 additions & 1 deletion PhotoBrowser/ZLThumbnailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ - (void)dealloc
strongSelf.arrDataSources = [NSMutableArray arrayWithArray:strongSelf.albumListModel.models];
[hud hide];
dispatch_async(dispatch_get_main_queue(), ^{
strongSelf.allowTakePhoto = YES;
if (weakNav.allowTakePhotoInLibrary && weakNav.allowSelectImage) {
strongSelf.allowTakePhoto = YES;
}
[strongSelf.collectionView reloadData];
[strongSelf scrollToBottom];
});
Expand Down
2 changes: 1 addition & 1 deletion ZLPhotoBrowser.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'ZLPhotoBrowser'
s.version = '2.4.4'
s.version = '2.4.5'
s.summary = 'A simple way to multiselect photos,video,gif,livephoto from ablum,force touch to preview image,support portrait and landscape,multiple languages(Chinese,English,Japanese)'
s.homepage = 'https://github.com/longitachi/ZLPhotoBrowser'
s.license = 'MIT'
Expand Down
4 changes: 3 additions & 1 deletion ZLPhotoBrowser/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ @interface ViewController () <UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@property (nonatomic, strong) NSArray *arrDataSources;

@property (nonatomic, assign) BOOL isOriginal;

@end

Expand Down Expand Up @@ -126,6 +127,7 @@ - (ZLPhotoActionSheet *)getPas
[actionSheet setSelectImageBlock:^(NSArray<UIImage *> * _Nonnull images, NSArray<PHAsset *> * _Nonnull assets, BOOL isOriginal) {
strongify(weakSelf);
strongSelf.arrDataSources = images;
strongSelf.isOriginal = isOriginal;
strongSelf.lastSelectAssets = assets.mutableCopy;
strongSelf.lastSelectPhotos = images.mutableCopy;
[strongSelf.collectionView reloadData];
Expand Down Expand Up @@ -173,7 +175,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
[[self getPas] previewSelectedPhotos:self.lastSelectPhotos assets:self.lastSelectAssets index:indexPath.row];
[[self getPas] previewSelectedPhotos:self.lastSelectPhotos assets:self.lastSelectAssets index:indexPath.row isOriginal:self.isOriginal];
}

- (IBAction)btnPreviewNetImageClick:(id)sender
Expand Down

0 comments on commit e50781c

Please sign in to comment.