Wechat(TX)
and Weibo(Sina)
in ChinaDESCRIPTION |
---|
Base on UIViewController |
Adapt for rotate of the screen, split screen of iPad |
Adapt for iPhone5 ~iPhone14Pro_Max |
Locate and net image and gif image |
Locate and net video |
PageControl can add target to change value [API] |
PanGesture to dismiss or cancel(normal image, long image, video) [API] |
Prefetch image, max is 8 [API] |
Video player auto play [API] |
Video player times speed play [API] |
Video player support play online(no cache,no download) [API] |
Video player support play after download(it will search next time) [API] |
Show custom view on PhotoBrowser [API] |
Show custom view on PhotoBrowser, and set animated following photoBrowser [API] |
Before the photoBrowser show, all image control can be custom [API] |
All operation though the delegate [Delegate] |
push ViewController (2022-12) [API] |
reload collection dataSource (2022-12) [API] |
load locate image with source path (2024-03) [API] |
>=SDWebImage(5.0)
, if need locate gif image, depend >=SDWebImage(5.8.3)
// 1.make every control as an object, put it into an array
KNPhotoItems *items = [[KNPhotoItems alloc] init];
items.url = @"http://xxxxxxxx/xxx.png";
items.sourceView = imageView;
// if current url is video type
// items.isVideo = true;
// if current image is locate gif
// itemM.isLocateGif = true;
// if current image is locate image with path url
// itemM.url = @"/xx/ssd/xxx/ss.png"
// itemM.
[self.itemsArr addObject:items];
KNPhotoBrowser *photoBrowser = [[KNPhotoBrowser alloc] init];
photoBrowser.itemsArr = [self.itemsArr copy];
photoBrowser.currentIndex = tap.view.tag;
/// photoBrowser will present
[photoBrowser present];
/// photoBrowser will dismiss
/// [photoBrowser dismiss];
/// photoBrowser will dismiss with currentIndex
- (void)photoBrowser:(KNPhotoBrowser *)photoBrowser willDismissWithIndex:(NSInteger)index;
/// photoBrowser right top button did click with currentIndex (you can custom you right button, but if you custom your right button, that you need implementate your target action)
- (void)photoBrowser:(KNPhotoBrowser *)photoBrowser rightBtnOperationActionWithIndex:(NSInteger)index;
.....
/// if it is network image, set `url` , do not set `sourceImage`
@property (nonatomic,copy ) NSString *url;
/// if it is locate image, set `sourceImage`, do not set `url`
@property (nonatomic,strong) UIImage *sourceImage;
/// sourceView is current control to show image or video.
/// 1. if the sourceView is kind of `UIImageView` or `UIButton` , just only only only set the `sourceView`.
/// 2. if the sourceView is the custom view , set the `sourceView`, but do not forget set `sourceLinkArr` && `sourceLinkProperyName`.
@property (nonatomic,strong) UIView *sourceView;
@property (nonatomic,strong) NSArray<NSString *> *sourceLinkArr;
/**
eg:
if the lastObject is kind of UIImageView , the `sourceLinkProperyName` is `image`
if the lastObject is kind of UIButton , the `sourceLinkProperyName` is `currentBackgroundImage` or `currentImage`
*/
/// the property'name of the sourceLinkArr lastObject
@property (nonatomic,copy ) NSString *sourceLinkProperyName;
pod 'KNPhotoBrowser'
// terminal : cd ~(current path)
pod install or pod update