Latest 0.3.0
Homepage https://github.com/banchichen/TZImagePreviewController
License MIT
Platforms ios 8.0, requires ARC
Dependencies TZImagePickerController
Frameworks Photos
Authors

CocoaPods

Enhance the TZImagePickerController library, supports to preview photo by UIImage or NSURL and preview video by NSURL.
TZImagePickerController库的增强,支持用UIImage、NSURL预览照片和用NSURL预览视频。

一. Installation 安装

CocoaPods

pod ‘TZImagePreviewController’

手动安装

将TZImagePickerController文件夹拽入项目中,导入头文件:#import "TZImagePreviewController.h"

二. Example 例子

TZImagePreviewController *previewVc = [[TZImagePreviewController alloc] initWithPhotos:self.selectedPhotos currentIndex:indexPath.row tzImagePickerVc:[self createTZImagePickerController]];
[previewVc setBackButtonClickBlock:^(BOOL isSelectOriginalPhoto) {
    NSLog(@"back isSelectOriginalPhoto:%d", isSelectOriginalPhoto);
}];
[previewVc setSetImageWithURLBlock:^(NSURL *URL, UIImageView *imageView) {
    [imageView sd_setImageWithURL:URL];
}];
[previewVc setDoneButtonClickBlock:^(NSArray *photos, BOOL isSelectOriginalPhoto) {
    self.selectedPhotos = [NSMutableArray arrayWithArray:photos];
    NSLog(@"done isSelectOriginalPhoto:%d photos.count:%zd", isSelectOriginalPhoto, photos.count);
    [self.collectionView reloadData];
}];
[self presentViewController:previewVc animated:YES completion:nil];

三. Requirements 要求

iOS 8 or later. Requires ARC
iOS8及以上系统可使用. ARC环境.

四. More 更多

There is Demo inside, Please refer to Demo for usage.
内有Demo,请参考Demo进行使用。

Latest podspec

{
    "name": "TZImagePreviewController",
    "version": "0.3.0",
    "summary": "Enhance the TZImagePickerController library, supports to preview photo by UIImage or NSURL and preview video by NSURL.",
    "homepage": "https://github.com/banchichen/TZImagePreviewController",
    "license": "MIT",
    "authors": {
        "banchichen": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/banchichen/TZImagePreviewController.git",
        "tag": "0.3.0"
    },
    "requires_arc": true,
    "source_files": "TZImagePreviewController/TZImagePreviewController/*.{h,m}",
    "frameworks": "Photos",
    "dependencies": {
        "TZImagePickerController": [
            ">=3.1.7"
        ]
    }
}

Pin It on Pinterest

Share This