{"id":13696798,"url":"https://github.com/cuzv/PhotoBrowser","last_synced_at":"2025-05-03T17:32:26.567Z","repository":{"id":41203201,"uuid":"41725481","full_name":"cuzv/PhotoBrowser","owner":"cuzv","description":"PhotoBrowser is a light weight photo browser, like the wechat, weibo image viewer.","archived":false,"fork":false,"pushed_at":"2018-09-22T06:48:17.000Z","size":69236,"stargazers_count":217,"open_issues_count":4,"forks_count":41,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T08:48:59.485Z","etag":null,"topics":["imageviewer","photobrowser","twitter","wechat","weibo"],"latest_commit_sha":null,"homepage":null,"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/cuzv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-01T08:04:24.000Z","updated_at":"2024-12-19T16:37:27.000Z","dependencies_parsed_at":"2022-09-12T14:31:41.199Z","dependency_job_id":null,"html_url":"https://github.com/cuzv/PhotoBrowser","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuzv%2FPhotoBrowser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuzv%2FPhotoBrowser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuzv%2FPhotoBrowser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuzv%2FPhotoBrowser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuzv","download_url":"https://codeload.github.com/cuzv/PhotoBrowser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252226858,"owners_count":21714885,"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":["imageviewer","photobrowser","twitter","wechat","weibo"],"created_at":"2024-08-02T18:00:47.384Z","updated_at":"2025-05-03T17:32:26.552Z","avatar_url":"https://github.com/cuzv.png","language":"Objective-C","funding_links":[],"categories":["UI Components"],"sub_categories":[],"readme":"[![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/cuzv/PhotoBrowser/blob/master/LICENSE)\n[![CocoaPods Compatible](https://img.shields.io/badge/CocoaPods-v0.8.1-green.svg)](https://github.com/CocoaPods/CocoaPods)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Weibo](https://img.shields.io/badge/Weibo-cuzval-yellowgreen.svg)](https://weibo.com/cuzval/)\n[![Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/cuzval)\n\n# PhotoBrowser\n\nPhotoBrowser is a light weight photo browser, like the wechat, weibo image viewer.\n\nNow, the pure Swift version named [SlidingPhoto](https://github.com/cuzv/SlidingPhoto) is available.\n\n### Features\n\n-   [x] Present \u0026 Dismissal animation \u0026 gesture\n-   [x] GIF support\n-   [x] Display long picture\n\n## How does it look like?\n\n\u003cp align=\"left\"\u003e\n\u003cimg src=\"./Preview/1.gif\" width=240px\"\u003e\u0026nbsp;\u003cimg src=\"./Preview/2.gif\" width=240px\"\u003e\u0026nbsp;\u003cimg src=\"./Preview/3.gif\" width=240px\"\u003e\n\u003c/p\u003e\n\n## Usage\n\n- Like the `UITableView` API, We have `DataSource` an `Delegate` for load data and handle action\n- Tell `PhotoBrowser` how many pages would you like to present by conforms protocol `PBViewControllerDataSource` and implement `numberOfPagesInViewController:` selector\n- Optional set the initialize page by `pb_startPage` property\n- Use for static Image - Conforms protocol `PBViewControllerDataSource` and implement `viewController:imageForPageAtIndex:` selector\n- Use for web image - Conforms protocol `PBViewControllerDataSource` and implement `viewController:presentImageView:forPageAtIndex:progressHandler` selector\n- Support animation - Conforms protocol `PBViewControllerDataSource` and implement `thumbViewForPageAtIndex:` tell the start and ended imageView position\n- Action callbacks - Conforms protocol `PBViewControllerDelegate` and implement `viewController:didSingleTapedPageAtIndex:presentedImage:` or `viewController:didLongPressedPageAtIndex:presentedImage:` handle single tap or long press action\n\n## Demo code\n\n``` objective-c\n...\nPBViewController *pbViewController = [PBViewController new];\n// Use your own subclass of UIImageView to display.\npbViewController.imageViewClass = PBImageView.class;\npbViewController.pb_dataSource = self;\npbViewController.pb_delegate = self;\npbViewController.pb_startPage = sender.tag;\n[self presentViewController:pbViewController animated:YES completion:nil];\n...\n\n...\n#pragma mark - PBViewControllerDataSource\n\n- (NSInteger)numberOfPagesInViewController:(PBViewController *)viewController {\n    return self.frames.count;\n}\n\n- (void)viewController:(PBViewController *)viewController presentImageView:(UIImageView *)imageView forPageAtIndex:(NSInteger)index progressHandler:(void (^)(NSInteger, NSInteger))progressHandler {\n    NSString *url = [NSString stringWithFormat:@\"https://raw.githubusercontent.com/cuzv/PhotoBrowser/dev/Example/Assets/%@.jpg\", @(index + 1)];\n    UIImage *placeholder = self.imageViews[index].image;\n    [imageView sd_setImageWithURL:[NSURL URLWithString:url]\n                 placeholderImage:placeholder\n                          options:0\n                         progress:progressHandler\n                        completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {\n                        }];\n}\n\n- (UIView *)thumbViewForPageAtIndex:(NSInteger)index {\n    if (self.thumb) {\n        return self.imageViews[index];\n    }\n    return nil;\n}\n\n#pragma mark - PBViewControllerDelegate\n\n- (void)viewController:(PBViewController *)viewController didSingleTapedPageAtIndex:(NSInteger)index presentedImage:(UIImage *)presentedImage {\n    [self dismissViewControllerAnimated:YES completion:nil];\n}\n```\n\nFor more information checkout the Example in project.\n\n## License\n\n`PhotoBrowser` is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuzv%2FPhotoBrowser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuzv%2FPhotoBrowser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuzv%2FPhotoBrowser/lists"}