{"id":13696739,"url":"https://github.com/LuKane/KNPhotoBrowser","last_synced_at":"2025-05-03T17:32:12.278Z","repository":{"id":38419880,"uuid":"67658105","full_name":"LuKane/KNPhotoBrowser","owner":"LuKane","description":"图片浏览器(本地和网络) ,视频浏览器 (本地和网络), 无耦合性,自定义控件,资源路径保存和获取,  完美适配 iPhone 以及 iPad ,屏幕旋转功能.","archived":false,"fork":false,"pushed_at":"2024-04-04T12:42:22.000Z","size":34179,"stargazers_count":373,"open_issues_count":4,"forks_count":77,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-31T16:15:12.764Z","etag":null,"topics":["collectionview","delegate","download","ios","ipad","iphone","loading","objective-c","pagecontrol","photobrowser","pod","rotate","sdwebimage","uiviewcontroller","video","video-player"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LuKane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-09-08T01:45:50.000Z","updated_at":"2024-09-23T12:41:44.000Z","dependencies_parsed_at":"2024-04-13T00:42:34.766Z","dependency_job_id":"96dc97f8-9dde-4f93-a57c-7ba40e2e6779","html_url":"https://github.com/LuKane/KNPhotoBrowser","commit_stats":{"total_commits":607,"total_committers":4,"mean_commits":151.75,"dds":0.009884678747940745,"last_synced_commit":"1e87a127aa0a9a1ca8e997f735e4282128dede8c"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuKane%2FKNPhotoBrowser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuKane%2FKNPhotoBrowser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuKane%2FKNPhotoBrowser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuKane%2FKNPhotoBrowser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LuKane","download_url":"https://codeload.github.com/LuKane/KNPhotoBrowser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224369717,"owners_count":17299946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collectionview","delegate","download","ios","ipad","iphone","loading","objective-c","pagecontrol","photobrowser","pod","rotate","sdwebimage","uiviewcontroller","video","video-player"],"created_at":"2024-08-02T18:00:46.082Z","updated_at":"2024-11-13T00:30:56.716Z","avatar_url":"https://github.com/LuKane.png","language":"Objective-C","funding_links":[],"categories":["UI Components"],"sub_categories":[],"readme":"![image](https://upload-images.jianshu.io/upload_images/1693073-222e76b529bc5f9e.png)\n\n[![CocoaPods](http://img.shields.io/cocoapods/v/KNPhotoBrowser.svg?style=flat)](http://cocoapods.org/?q=KNPhotoBrowser)\u0026nbsp;![CocoaPods](http://img.shields.io/cocoapods/p/KNPhotoBrowser.svg?style=flat)\u0026nbsp;[![Support](https://img.shields.io/badge/support-iOS%209.0%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)\u0026nbsp;\n\n# KNPhotoBrowser\n[中文](https://github.com/LuKane/KNPhotoBrowser/blob/master/README_Chinese.md) | [English](https://github.com/LuKane/KNPhotoBrowser/blob/master/README.md)\n\n#### most like photo or video browser of `Wechat(TX)` and `Weibo(Sina)` in China\n#### if you get any function to add, just contact me by E-mail. Welcome to Star \n\n\n![image](https://upload-images.jianshu.io/upload_images/1693073-aa996299e74d04b8.gif)![image](https://upload-images.jianshu.io/upload_images/1693073-3c8632a1c5413564.gif)![image](https://upload-images.jianshu.io/upload_images/1693073-5db630d194aaba91.gif)![image](https://upload-images.jianshu.io/upload_images/1693073-c4b3c40b49899a2a.gif)![image](https://upload-images.jianshu.io/upload_images/1693073-934ff5b95e03083c.gif)\n\n## Update content\n\n| DESCRIPTION | \n| ------------- |\n| Base on UIViewController |\n| Adapt for rotate of the screen, split screen of iPad |\n| Adapt for `iPhone5`~`iPhone14Pro_Max` |\n| Locate and net image and gif image | \n| Locate and net video |\n| PageControl can add target to change value [**API**] |\n| PanGesture to dismiss or cancel(normal image, long image, video) [**API**]  |\n| Prefetch image, max is 8 [**API**]  | \n| Video player auto play [**API**]  | \n| Video player times speed play [**API**]  |\n| Video player support play online(no cache,no download) [**API**]  |\n| Video player support play after download(it will search next time) [**API**]  |\n| Show custom view on PhotoBrowser [**API**]  |\n| Show custom view on PhotoBrowser, and set animated following photoBrowser [**API**]  |\n| Before the photoBrowser show, all image control can be custom [**API**]  | \n| All operation though the delegate [**Delegate**]  |\n| push ViewController (2022-12) [**API**]  | \n| reload collection dataSource (2022-12) [**API**]  | \n| load locate image with source path (2024-03) [**API**]  | \n\n\n## TODO: \n* tap video player to dismiss [Finished in demo]\n* play video player and download video background\n* video player has memory play at next time(current seconds)\n* when photoBrower will show or dismiss, let sourceImageView hidden or show (by delegate function to notificate demo) [Finished in demo]\n* video player change scale\n\n## 1.Before use, you need to know\n* 1.depend `\u003e=SDWebImage(5.0)`, if need locate gif image, depend `\u003e=SDWebImage(5.8.3)`\n* 2.image and video play is ready for use\n* 3.download image or video is ready for use\n* 4.custom control as you wish\n* 5.auto manager image or video of download is finished\n\n## 2.How to use\n\n### (1).init base params\n```objc\n// 1.make every control as an object, put it into an array\nKNPhotoItems *items = [[KNPhotoItems alloc] init];\nitems.url = @\"http://xxxxxxxx/xxx.png\";\nitems.sourceView = imageView;\n// if current url is video type\n// items.isVideo = true;\n// if current image is locate gif\n// itemM.isLocateGif = true;\n\n// if current image is locate image with path url\n// itemM.url = @\"/xx/ssd/xxx/ss.png\"\n// itemM.\n\n[self.itemsArr addObject:items];\n```\n### (2).init PhotoBrowser\n\n```objc\nKNPhotoBrowser *photoBrowser = [[KNPhotoBrowser alloc] init];\nphotoBrowser.itemsArr = [self.itemsArr copy];\nphotoBrowser.currentIndex = tap.view.tag;\n\n/// photoBrowser will present\n[photoBrowser present];\n\n/// photoBrowser will dismiss\n/// [photoBrowser dismiss];\n```\n\n### (3).function's describe of delegate\n\n##### photoBrowser will dismiss\n```objc\n/// photoBrowser will dismiss with currentIndex\n- (void)photoBrowser:(KNPhotoBrowser *)photoBrowser willDismissWithIndex:(NSInteger)index;\n```\n##### photoBrowser right button did click\n```objc\n/// 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)\n- (void)photoBrowser:(KNPhotoBrowser *)photoBrowser rightBtnOperationActionWithIndex:(NSInteger)index;\n```\n.....\n### (4).component of browser : KNPhotoItems\n##### base params of items\n```objc\n/// if it is network image,  set `url` , do not set `sourceImage`\n@property (nonatomic,copy  ) NSString *url;\n\n/// if it is locate image, set `sourceImage`, do not set `url`\n@property (nonatomic,strong) UIImage *sourceImage;\n\n/// sourceView is current control to show image or video.\n/// 1. if the sourceView is kind of `UIImageView` or `UIButton` , just only only only set the `sourceView`.\n/// 2. if the sourceView is the custom view , set the `sourceView`, but do not forget set `sourceLinkArr` \u0026\u0026 `sourceLinkProperyName`.\n@property (nonatomic,strong) UIView *sourceView;\n```\n##### custom source View (it is very nice)\n```objc\n@property (nonatomic,strong) NSArray\u003cNSString *\u003e *sourceLinkArr;\n\n/**\n eg:\n    if the lastObject is kind of  UIImageView ,  the `sourceLinkProperyName` is `image`\n    if the lastObject is kind of  UIButton ,  the `sourceLinkProperyName` is `currentBackgroundImage` or `currentImage`\n */\n\n/// the property'name of the  sourceLinkArr lastObject\n@property (nonatomic,copy  ) NSString *sourceLinkProperyName;\n\n```\n\n## 3.How to install \n```objc\npod 'KNPhotoBrowser'\n\n// terminal : cd ~(current path)\npod install or pod update\n\n```\n\n## 5.By the way\n* if you get any idea, just contact me! Thanks\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLuKane%2FKNPhotoBrowser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLuKane%2FKNPhotoBrowser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLuKane%2FKNPhotoBrowser/lists"}