# JBrowserSDK **Repository Path**: appkf_admin/JBrowserSDK ## Basic Information - **Project Name**: JBrowserSDK - **Description**: oc图片视频浏览库 - **Primary Language**: Objective-C - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-01-04 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # JBrowserSDK [![CI Status](http://img.shields.io/travis/jhfappkf@163.com/JBrowserSDK.svg?style=flat)](https://travis-ci.org/jhfappkf@163.com/JBrowserSDK) [![Version](https://img.shields.io/cocoapods/v/JBrowserSDK.svg?style=flat)](http://cocoapods.org/pods/JBrowserSDK) [![License](https://img.shields.io/cocoapods/l/JBrowserSDK.svg?style=flat)](http://cocoapods.org/pods/JBrowserSDK) [![Platform](https://img.shields.io/cocoapods/p/JBrowserSDK.svg?style=flat)](http://cocoapods.org/pods/JBrowserSDK) ## Example To run the example project, clone the repo, and run `pod install` from the Example directory first. ## Requirements ## Installation JBrowserSDK is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby pod 'JBrowserSDK', :git => 'https://gitee.com/appkf/JBrowserSDK.git' ``` ## 使用 ``` #import - (IBAction)url:(id)sender { NSMutableArray *items = [NSMutableArray array]; JPhotoItem *item; [[self imageUrls] enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { JPhotoItem *item = [[JPhotoItem alloc] initWithSourceView:self.imageview imageUrl:[NSURL URLWithString:obj]]; [items addObject:item]; }]; item = [[JPhotoItem alloc] initWithSourceView:self.imageview thumbImageUrl:[NSURL URLWithString:@"https://ss1.bdstatic.com/kvoZeXSm1A5BphGlnYG/skin_zoom/449.jpg"] videoUrl:[NSURL URLWithString:@"http://www.w3school.com.cn/example/html5/mov_bbb.mp4"]]; [items addObject:item]; JPhotoBrowser *browser = [[JPhotoBrowser alloc] initWithPhotoItems:items selectedIndex:0]; browser.delegate = self; browser.bounces = NO; browser.dismissalStyle = JPhotoBrowserInteractiveDismissalStyleScale; [browser showFromViewController:self]; } - (void)j_photoBrowser:(JPhotoBrowser *)browser didSelectItem:(JPhotoItem *)item atIndex:(NSUInteger)index; { NSLog(@"%ld",index); } - (NSArray *)imageUrls{ NSMutableArray *array = [NSMutableArray array]; [array addObject:@"https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3445497520,1801625963&fm=27&gp=0.jpg"]; for (int i = 0; i < 10; i++) { [array addObject:[NSString stringWithFormat:@"https://ss1.bdstatic.com/kvoZeXSm1A5BphGlnYG/skin_zoom/%d.jpg",449 + i]]; } [array addObject:@"https://pic2.zhimg.com/v2-19169fea7463f3324ae00ab9bf2fbc75_b.gif"]; return array.copy; } ``` ## Author jhfappkf@163.com, jhfappkf@163.com ## License JBrowserSDK is available under the MIT license. See the LICENSE file for more info.