TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Sep 2015 |
Maintained by David Tse.
Yet another photo browser of displaying images.
_simplePhotoBrowser = [[DXPhotoBrowser alloc] initWithPhotosArray:@[ id<DXPhoto> ]];
[_simplePhotoBrowser showPhotoAtIndex:someIndexWithThePhotos withThumbnailImageView:someImageViewOrNil];
id<DXPhoto>
required protocol method loadImageWithProgressBlock:completionBlock:
could be imp like this
- (void)loadImageWithProgressBlock:(DXPhotoProgressBlock)progressBlock completionBlock:(DXPhotoCompletionBlock)completionBlock {
__weak typeof(self) wself = self;
SDWebImageCompletionWithFinishedBlock finishBlock = ^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
if (completionBlock) {
completionBlock(wself, image);
}
};
_operation = [[SDWebImageManager sharedManager] downloadImageWithURL:[NSURL URLWithString:_imageURL] options:1 progress:nil completed:finishBlock];
}
- (void)cancelLoadImage {
[_operation cancel];
_operation = nil;
}
For more details best practises, check DXSimplePhoto.
To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS '~6.0'
DXPhotoBrowser is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "DXPhotoBrowser"
DXPhotoBrowser is available under the MIT license. See the LICENSE file for more info.