- 1.photoBrowser has been recoded , turn the
UIView
to theUIViewController
- 2.adapt
iPhoneX
、iPhoneXS
、iPhoneXR
、iPhoneXS_Max
- 3.perfect adapt the rotate of the Screen,try on the real iPhone or iPad
- 4.photoBrowser for IM (like
Wechat
chat session) - 5.photoBrowser add prefetch image API (2019/3/13)
- 6.photoBrowser add panGesture to dismiss or cancel(2019/4/16)
- 1.Depend
SDWebImage(5.0)
andFLAnimatedImage
- 2.load nine picture ,scrollView,tableView,chat session for IM
- 3.most like photoBrowser of Wechat and Weibo in China
- 4.provide function which can delete and download image
- 5.the other type's Demo will be upload soon
// 1.make every control as an object, put it into an array
KNPhotoItems *items = [[KNPhotoItems alloc] init];
items.url = [urlArr[i] stringByReplacingOccurrencesOfString:@"thumbnail" withString:@"bmiddle"];
items.sourceView = imageView;
[self.itemsArr addObject:items];
// jump to the photobrowser --> you can see in the Demo
KNPhotoBrowser *photoBrowser = [[KNPhotoBrowser alloc] init];
photoBrowser.itemsArr = [self.itemsArr copy];
photoBrowser.isNeedPageControl = true;
photoBrowser.isNeedPageNumView = true;
photoBrowser.isNeedRightTopBtn = true;
photoBrowser.isNeedPrefetch = true;
photoBrowser.isNeedPictureLongPress = true;
photoBrowser.currentIndex = tap.view.tag;
[photoBrowser present];
/* PhotoBrowser will dismiss */
- (void)photoBrowserWillDismiss;
/* PhotoBrowser right top btn show and ActionSheet will click with Index */
- (void)photoBrowserRightOperationActionWithIndex:(NSInteger)index;
/* PhotoBrowser save pic is success or not */
- (void)photoBrowserWriteToSavedPhotosAlbumStatus:(BOOL)success;
/* PhotoBrowser delete image --> relative index */
- (void)photoBrowserRightOperationDeleteImageSuccessWithRelativeIndex:(NSInteger)index;
/* PhotoBrowser delete image --> absolute Index */
- (void)photoBrowserRightOperationDeleteImageSuccessWithAbsoluteIndex:(NSInteger)index;
// maybe you never use it
[_photoBrowser dismiss];
/**
current select index
*/
@property (nonatomic,assign) NSInteger currentIndex;
/**
contain KNPhotoItems : url && UIView
*/
@property (nonatomic,strong) NSArray<KNPhotoItems *> *itemsArr;
/**
contain ActionSheet alert contents ,which is belong NSString type
*/
@property (nonatomic,strong) NSArray<NSString *> *actionSheetArr;
/**
is or not need pageNumView , Default is false
*/
@property (nonatomic,assign) BOOL isNeedPageNumView;
/**
is or not need pageControl , Default is false
*/
@property (nonatomic,assign) BOOL isNeedPageControl;
/**
is or not need RightTopBtn , Default is false
*/
@property (nonatomic,assign) BOOL isNeedRightTopBtn;
/**
is or not need PictureLongPress , Default is false
*/
@property (nonatomic, assign) BOOL isNeedPictureLongPress;
/**
is or not need pan Gesture, Default is false
*/
@property (nonatomic,assign) BOOL isNeedPanGesture;
/**
PhotoBrowser show
*/
- (void)present;
/**
PhotoBrowser dismiss
*/
- (void)dismiss;
// about ActionSheet, if you use it with much code, just let the `self` become `weakSelf`
__weak typeof(self) weakSelf = self;
KNActionSheet *actionSheet = [[KNActionSheet alloc] initWithCancelTitle:nil otherTitleArr:self.actionSheetArr.copy actionBlock:^(NSInteger buttonIndex) {
if([weakSelf.delegate respondsToSelector:@selector(photoBrowserRightOperationActionWithIndex:)]){
[weakSelf.delegate photoBrowserRightOperationActionWithIndex:buttonIndex];
}
}];
[actionSheet show];
- 1.Currently, It just be used in nine picure ,scrollView, tableView , chat session for IM
- 2.if you find any bug, just contact me, it will be perfect by each other
- 3.perfect adapt
iPhone
iPad
- 4.perfect adapt the
rotate of the Screen
likeWechat
andWeibo