Commit cfa31a85 authored by yuzheng.tz's avatar yuzheng.tz

1. 修复Bug:选择照片结束后,dealloc方法会在15秒后才调用;

2. 删除imagePickerControllerDidCancel的代理方法;
parent f3a731aa
...@@ -29,7 +29,7 @@ static CGFloat TZScreenScale; ...@@ -29,7 +29,7 @@ static CGFloat TZScreenScale;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
manager = [[self alloc] init]; manager = [[self alloc] init];
if (iOS8Later) { if (iOS8Later) {
manager.cachingImageManager = [[PHCachingImageManager alloc] init]; // manager.cachingImageManager = [[PHCachingImageManager alloc] init];
// manager.cachingImageManager.allowsCachingHighQualityImages = YES; // manager.cachingImageManager.allowsCachingHighQualityImages = YES;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// //
// Created by 谭真 on 15/12/24. // Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved. // Copyright © 2015年 谭真. All rights reserved.
// version 1.7.8 - 2016.12.20 // version 1.7.9 - 2017.04.01
/* /*
经过测试,比起xib的方式,把TZAssetCell改用纯代码的方式来写,滑动帧数明显提高了(约提高10帧左右) 经过测试,比起xib的方式,把TZAssetCell改用纯代码的方式来写,滑动帧数明显提高了(约提高10帧左右)
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
// photos数组里的UIImage对象,默认是828像素宽,你可以通过设置photoWidth属性的值来改变它 // photos数组里的UIImage对象,默认是828像素宽,你可以通过设置photoWidth属性的值来改变它
- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto; - (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto;
- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto infos:(NSArray<NSDictionary *> *)infos; - (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto infos:(NSArray<NSDictionary *> *)infos;
- (void)imagePickerControllerDidCancel:(TZImagePickerController *)picker __attribute__((deprecated("Use -tz_imagePickerControllerDidCancel:."))); //- (void)imagePickerControllerDidCancel:(TZImagePickerController *)picker __attribute__((deprecated("Use -tz_imagePickerControllerDidCancel:.")));
- (void)tz_imagePickerControllerDidCancel:(TZImagePickerController *)picker; - (void)tz_imagePickerControllerDidCancel:(TZImagePickerController *)picker;
// If user picking a video, this callback will be called. // If user picking a video, this callback will be called.
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// //
// Created by 谭真 on 15/12/24. // Created by 谭真 on 15/12/24.
// Copyright © 2015年 谭真. All rights reserved. // Copyright © 2015年 谭真. All rights reserved.
// version 1.7.8 - 2016.12.20 // version 1.7.9 - 2017.04.01
#import "TZImagePickerController.h" #import "TZImagePickerController.h"
#import "TZPhotoPickerController.h" #import "TZPhotoPickerController.h"
...@@ -316,8 +316,9 @@ ...@@ -316,8 +316,9 @@
[[UIApplication sharedApplication].keyWindow addSubview:_progressHUD]; [[UIApplication sharedApplication].keyWindow addSubview:_progressHUD];
// if over time, dismiss HUD automatic // if over time, dismiss HUD automatic
__weak typeof(self) weakSelf = self;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.timeout * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.timeout * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self hideProgressHUD]; [weakSelf hideProgressHUD];
}); });
} }
...@@ -466,6 +467,10 @@ ...@@ -466,6 +467,10 @@
return UIInterfaceOrientationMaskPortrait; return UIInterfaceOrientationMaskPortrait;
} }
- (void)dealloc {
NSLog(@"%@ dealloc",NSStringFromClass(self.class));
}
#pragma mark - Public #pragma mark - Public
- (void)cancelButtonClick { - (void)cancelButtonClick {
...@@ -479,10 +484,12 @@ ...@@ -479,10 +484,12 @@
} }
- (void)callDelegateMethod { - (void)callDelegateMethod {
/*
// 兼容旧版本 // 兼容旧版本
if ([self.pickerDelegate respondsToSelector:@selector(imagePickerControllerDidCancel:)]) { if ([self.pickerDelegate respondsToSelector:@selector(imagePickerControllerDidCancel:)]) {
[self.pickerDelegate imagePickerControllerDidCancel:self]; [self.pickerDelegate imagePickerControllerDidCancel:self];
} }
*/
if ([self.pickerDelegate respondsToSelector:@selector(tz_imagePickerControllerDidCancel:)]) { if ([self.pickerDelegate respondsToSelector:@selector(tz_imagePickerControllerDidCancel:)]) {
[self.pickerDelegate tz_imagePickerControllerDidCancel:self]; [self.pickerDelegate tz_imagePickerControllerDidCancel:self];
} }
...@@ -566,6 +573,10 @@ ...@@ -566,6 +573,10 @@
}]; }];
} }
- (void)dealloc {
NSLog(@"%@ dealloc",NSStringFromClass(self.class));
}
#pragma mark - UITableViewDataSource && Delegate #pragma mark - UITableViewDataSource && Delegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
......
...@@ -663,7 +663,7 @@ static CGSize AssetGridThumbnailSize; ...@@ -663,7 +663,7 @@ static CGSize AssetGridThumbnailSize;
} }
- (void)dealloc { - (void)dealloc {
//NSLog(@"TZPhotoPickerController dealloc"); NSLog(@"%@ dealloc",NSStringFromClass(self.class));
} }
#pragma mark - Asset Caching #pragma mark - Asset Caching
......
...@@ -384,7 +384,7 @@ ...@@ -384,7 +384,7 @@
#pragma mark - Private Method #pragma mark - Private Method
- (void)dealloc { - (void)dealloc {
//NSLog(@"TZPhotoPreviewController dealloc"); NSLog(@"%@ dealloc",NSStringFromClass(self.class));
} }
- (void)refreshNaviBarAndBottomBarState { - (void)refreshNaviBarAndBottomBarState {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment