{"id":1447,"url":"https://github.com/thiagoperes/IDMPhotoBrowser","last_synced_at":"2025-08-02T04:31:15.991Z","repository":{"id":41124951,"uuid":"11315781","full_name":"thiagoperes/IDMPhotoBrowser","owner":"thiagoperes","description":"Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more","archived":false,"fork":false,"pushed_at":"2024-04-11T07:41:23.000Z","size":9483,"stargazers_count":2709,"open_issues_count":194,"forks_count":642,"subscribers_count":91,"default_branch":"master","last_synced_at":"2024-10-29T15:33:06.890Z","etag":null,"topics":[],"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/thiagoperes.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"publiccode":null,"codemeta":null}},"created_at":"2013-07-10T15:26:15.000Z","updated_at":"2024-10-17T01:36:01.000Z","dependencies_parsed_at":"2022-08-10T01:35:36.971Z","dependency_job_id":"db3888c9-6c51-4c90-b083-273b1e4a9e94","html_url":"https://github.com/thiagoperes/IDMPhotoBrowser","commit_stats":{"total_commits":208,"total_committers":45,"mean_commits":4.622222222222222,"dds":0.6009615384615384,"last_synced_commit":"01fbba9cfa07199be79d5023e0178fd5f07a0a14"},"previous_names":["ideaismobile/idmphotobrowser"],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagoperes%2FIDMPhotoBrowser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagoperes%2FIDMPhotoBrowser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagoperes%2FIDMPhotoBrowser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagoperes%2FIDMPhotoBrowser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagoperes","download_url":"https://codeload.github.com/thiagoperes/IDMPhotoBrowser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228330157,"owners_count":17903019,"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":[],"created_at":"2024-01-05T20:15:46.667Z","updated_at":"2024-12-06T08:31:03.796Z","avatar_url":"https://github.com/thiagoperes.png","language":"Objective-C","funding_links":[],"categories":["Media","Objective-C","UI Components","Objective-C  Stars 1000以内排名整理"],"sub_categories":["Image","Other free courses"],"readme":"# IDMPhotoBrowser ![](http://cocoapod-badges.herokuapp.com/v/IDMPhotoBrowser/badge.png) ![](http://cocoapod-badges.herokuapp.com/p/IDMPhotoBrowser/badge.png)\n\nIDMPhotoBrowser is a new implementation based on [MWPhotoBrowser](https://github.com/mwaterfall/MWPhotoBrowser).\n\nWe've added both user experience and technical features inspired by Facebook's and Tweetbot's photo browsers.\n\n## New features:\n- Uses ARC\n- Uses SDWebImage for image loading\n- Image progress shown\n- Minimalistic Facebook-like interface, swipe up/down to dismiss\n- Ability to add custom actions on the action sheet\n\n## Features\n\n- Can display one or more images by providing either `UIImage` objects, file paths to images on the device, or URLs to images online\n- Handles the downloading and caching of photos from the web seamlessly\n- Photos can be zoomed and panned, and optional captions can be displayed\n\n## Screenshots\n\n[![Alt][screenshot1_thumb]][screenshot1]    [![Alt][screenshot2_thumb]][screenshot2]    [![Alt][screenshot3_thumb]][screenshot3]    [![Alt][screenshot4_thumb]][screenshot4]    [![Alt][screenshot5_thumb]][screenshot5]\n\n[screenshot1_thumb]: https://raw.github.com/appkraft/IDMPhotoBrowser/master/Screenshots/idmphotobrowser_thumb1.png\n[screenshot1]: https://raw.github.com/appkraft/IDMPhotoBrowser/master/Screenshots/idmphotobrowser_ss1.png\n[screenshot2_thumb]: https://raw.github.com/appkraft/IDMPhotoBrowser/master/Screenshots/idmphotobrowser_thumb2.png\n[screenshot2]: https://raw.github.com/appkraft/IDMPhotoBrowser/master/Screenshots/idmphotobrowser_ss2.png\n[screenshot3_thumb]: https://raw.github.com/appkraft/IDMPhotoBrowser/master/Screenshots/idmphotobrowser_thumb3.png\n[screenshot3]: https://raw.github.com/appkraft/IDMPhotoBrowser/master/Screenshots/idmphotobrowser_ss3.png\n[screenshot4_thumb]: https://raw.github.com/appkraft/IDMPhotoBrowser/master/Screenshots/idmphotobrowser_thumb4.png\n[screenshot4]: https://raw.github.com/appkraft/IDMPhotoBrowser/master/Screenshots/idmphotobrowser_ss4.png\n[screenshot5_thumb]: https://raw.github.com/appkraft/IDMPhotoBrowser/master/Screenshots/idmphotobrowser_thumb5.png\n[screenshot5]: https://raw.github.com/appkraft/IDMPhotoBrowser/master/Screenshots/idmphotobrowser_ss5.png\n\n## Usage\n\nSee the code snippet below for an example of how to implement the photo browser.\n\nFirst create a photos array containing IDMPhoto objects:\n\n``` objective-c\n// URLs array\nNSArray *photosURL = @[[NSURL URLWithString:@\"http://farm4.static.flickr.com/3567/3523321514_371d9ac42f_b.jpg\"], \n[NSURL URLWithString:@\"http://farm4.static.flickr.com/3629/3339128908_7aecabc34b_b.jpg\"], \n[NSURL URLWithString:@\"http://farm4.static.flickr.com/3364/3338617424_7ff836d55f_b.jpg\"], \n[NSURL URLWithString:@\"http://farm4.static.flickr.com/3590/3329114220_5fbc5bc92b_b.jpg\"]];\n    \n// Create an array to store IDMPhoto objects\nNSMutableArray *photos = [NSMutableArray new];\n\nfor (NSURL *url in photosURL) {\n\tIDMPhoto *photo = [IDMPhoto photoWithURL:url];\n\t[photos addObject:photo];\n}\n\t\n// Or use this constructor to receive an NSArray of IDMPhoto objects from your NSURL objects\nNSArray *photos = [IDMPhoto photosWithURLs:photosURL];\n````\n\nThere are two main ways to presente the photoBrowser, with a fade on screen or with a zooming effect from an existing view.\n\nUsing a simple fade transition:\n\n``` objective-c    \nIDMPhotoBrowser *browser = [[IDMPhotoBrowser alloc] initWithPhotos:photos];\n``` \n\nZooming effect from a view:\n\n``` objective-c    \nIDMPhotoBrowser *browser = [[IDMPhotoBrowser alloc] initWithPhotos:photos animatedFromView:sender];\n```\n\nWhen using this animation you can set the `scaleImage` property, in case the image from the view is not the same as the one that will be shown on the browser, so it will dynamically scale it:\n\n``` objective-c    \nbrowser.scaleImage = buttonSender.currentImage;\n```\n\nPresenting using a modal view controller:\n\n``` objective-c\n[self presentViewController:browser animated:YES completion:nil];\n```\n\n### Customization\n\n##### Toolbar\n\nYou can customize the toolbar. There are three boolean properties you can set: displayActionButton (default is YES), displayArrowButton (default is YES) and displayCounterLabel (default is NO). If you dont want the toolbar at all, you can set displayToolbar = NO.\n\nToolbar setup example:\n``` objective-c     \nbrowser.displayActionButton = NO;\nbrowser.displayArrowButton = YES;\nbrowser.displayCounterLabel = YES;\n```\n\nIt is possible to use your own image on the toolbar arrows:\n``` objective-c     \nbrowser.leftArrowImage = [UIImage imageNamed:@\"IDMPhotoBrowser_customArrowLeft.png\"];\nbrowser.rightArrowImage = [UIImage imageNamed:@\"IDMPhotoBrowser_customArrowRight.png\"];\nbrowser.leftArrowSelectedImage = [UIImage imageNamed:@\"IDMPhotoBrowser_customArrowLeftSelected.png\"];\nbrowser.rightArrowSelectedImage = [UIImage imageNamed:@\"IDMPhotoBrowser_customArrowRightSelected.png\"];\n```\n\nIf you want to use custom actions, set the actionButtonTitles array with the titles for the actionSheet. Then, implement the photoBrowser:didDismissActionSheetWithButtonIndex:photoIndex: method, from the IDMPhotoBrowser delegate\n\n``` objective-c    \nbrowser.actionButtonTitles = @[@\"Option 1\", @\"Option 2\", @\"Option 3\", @\"Option 4\"];\n```\n\n#### Others\n\nOthers customizations you can make are: use white background color, don't display the done button and change the done button background image:\n``` objective-c    \nbrowser.useWhiteBackgroundColor = YES;\nbrowser.displayDoneButton = NO;\nbrowser.doneButtonImage = [UIImage imageNamed:@\"IDMPhotoBrowser_customDoneButton.png\"];\n```\n\nIf you want to keep the interface shown when the user is scrolling :\n``` objective-c\nbrowser.autoHideInterface = NO;\n```\n\nYou can use a smooth [pop](https://github.com/facebook/pop) animation when presenting and dismissing a photo:\n``` objective-c\nbrowser.usePopAnimation = YES;\n```\n\nIf the presenting view controller doesn't have a status bar, in some cases you can force it to be hidden:\n``` objective-c\nbrowser.forceHideStatusBar = YES;\n```\n\nIt's possible to disable the vertical dismiss swipe gesture:\n``` objective-c\nbrowser.disableVerticalSwipe = YES;\n```\n\nDismiss the photo browser with a touch (instead of showing/hiding controls):\n``` objective-c\nbrowser.dismissOnTouch = YES;\n```\n\n### Photo Captions\n\nPhoto captions can be displayed simply by setting the `caption` property on specific photos:\n``` objective-c\nIDMPhoto *photo = [IDMPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@\"photo2l\" ofType:@\"jpg\"]];\nphoto.caption = @\"Campervan\";\n```\n\nNo caption will be displayed if the caption property is not set.\n\n#### Custom Captions\n\nBy default, the caption is a simple black transparent view with a label displaying the photo's caption in white. If you want to implement your own caption view, follow these steps:\n\n1. Optionally use a subclass of `IDMPhoto` for your photos so you can store more data than a simple caption string.\n2. Subclass `IDMCaptionView` and override `-setupCaption` and `-sizeThatFits:` (and any other UIView methods you see fit) to layout your own view and set it's size. More information on this can be found in `IDMCaptionView.h`\n3. Implement the `-photoBrowser:captionViewForPhotoAtIndex:` IDMPhotoBrowser delegate method (shown below).\n\nExample delegate method for custom caption view:\n``` objective-c\n- (IDMCaptionView *)photoBrowser:(IDMPhotoBrowser *)photoBrowser captionViewForPhotoAtIndex:(NSUInteger)index {\n\tIDMPhoto *photo = [self.photos objectAtIndex:index];\n\tMyIDMCaptionViewSubclass *captionView = [[MyIDMCaptionViewSubclass alloc] initWithPhoto:photo];\n\treturn captionView;\n}\n```\n\n## Adding to your project\n\n### Using CocoaPods\n\nJust add `pod 'IDMPhotoBrowser'` to your Podfile.\n\n### Including Source Directly Into Your Project\n\n#### Opensource libraries used\n\n- [SDWebImage](https://github.com/rs/SDWebImage)\n- [DACircularProgress](https://github.com/danielamitay/DACircularProgress)\n- [pop](https://github.com/facebook/pop)\n\n## Licence\n\nThis project uses MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagoperes%2FIDMPhotoBrowser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagoperes%2FIDMPhotoBrowser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagoperes%2FIDMPhotoBrowser/lists"}