ACImageBrowser
ACImageBrowser copied to clipboard
A customizable image browser and support screen rotation
ACImageBrowser
A customizable Image Browser
Installing
Drag ACImageBrowser folder into your project.
#import "ACImageBrowser.h"
Usage
// 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);
}
Customization
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.
Requirements
- iOS 7+
Open source project used
License
- MIT