A customizable Image Browser
Drag ACImageBrowser
folder into your project.
#import "ACImageBrowser.h"
// creat the array with your Images URL objects (notice: NSURL object), pass it to initWithImagesURLArray:
NSMutableArray *photosURL = [[NSMutableArray alloc] init];
// ......
ACImageBrowser *browser = [[ACImageBrowser alloc] initWithImagesURLArray:photosURL];
// Browse from which index.
[browser setPageIndex:2];
// Disable single tap to turn on and off fullscreen mode, default is YES.
browser.fullscreenEnable = NO;
// If you want to know ACImageBrowser dismiss at which index, use this delegate.
browser.delegate = self;
#pragma mark - ACImageBrowserDelegate
- (void)dismissAtIndex:(NSInteger)index {
[self dismissViewControllerAnimated:YES completion:nil];
NSLog(@"Dismiss at index: %lu", (unsigned long)index);
}
If you want to make subclass, here is some methods you should know.
//** for custom subclass working with things like bottom toolbar ******************
// default animation duration is ACIBU_BGColor_AnimationDuration (0.28f)
- (void)willAnimateToFullscreenMode;
- (void)willAnimateToNormalMode;
//*******************************************************************************//
//** deleting and saving **********************************************************
- (void)deletePhotoAtCurrentIndex:(void (^)(void))deletingBlock
success:(void (^)(BOOL finished))finishedBlock;
- (void)savePhotoToCameraRollProgress:(void (^)(CGFloat percent))progressBlock
success:(void (^)(BOOL success))successBlock;
//*******************************************************************************//
See more in the sample YourCustomACImageBrowser.m
.
- iOS 7+
- MIT