{"id":15037375,"url":"https://github.com/hyperoslo/gallery","last_synced_at":"2025-05-15T11:09:28.402Z","repository":{"id":48686371,"uuid":"66566064","full_name":"hyperoslo/Gallery","owner":"hyperoslo","description":"📹 Your next favorite image and video picker","archived":false,"fork":false,"pushed_at":"2021-07-14T08:16:15.000Z","size":6948,"stargazers_count":1426,"open_issues_count":24,"forks_count":274,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-05-15T11:09:28.089Z","etag":null,"topics":["imagepicker","ios","swift","video"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperoslo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-25T14:39:28.000Z","updated_at":"2025-05-12T15:59:50.000Z","dependencies_parsed_at":"2022-07-25T01:02:33.386Z","dependency_job_id":null,"html_url":"https://github.com/hyperoslo/Gallery","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2FGallery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2FGallery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2FGallery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2FGallery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperoslo","download_url":"https://codeload.github.com/hyperoslo/Gallery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328386,"owners_count":22052632,"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":["imagepicker","ios","swift","video"],"created_at":"2024-09-24T20:34:28.365Z","updated_at":"2025-05-15T11:09:28.385Z","avatar_url":"https://github.com/hyperoslo.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"Screenshots/Banner.png\" alt=\"Gallery Banner\" align=\"center\" /\u003e\n\n[![Version](https://img.shields.io/cocoapods/v/Gallery.svg?style=flat)](http://cocoadocs.org/docsets/Gallery)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![License](https://img.shields.io/cocoapods/l/Gallery.svg?style=flat)](http://cocoadocs.org/docsets/Gallery)\n[![Platform](https://img.shields.io/cocoapods/p/Gallery.svg?style=flat)](http://cocoadocs.org/docsets/Gallery)\n![Swift](https://img.shields.io/badge/%20in-swift%205.0-orange.svg)\n\n## Description\n\n\u003cimg src=\"Screenshots/Icon.png\" alt=\"Gallery Icon\" align=\"right\" width=\"250\" height=\"250\" /\u003e\n\nWe all love image pickers, don't we? You may already know of [ImagePicker](https://github.com/hyperoslo/ImagePicker), the all in one solution for capturing pictures and selecting images. Well, it has a sibling too, called `Gallery`. Based on the same engine that powers ImagePicker, Gallery has a clearer flow based on albums and focuses on the use case of selecting video. If this suits your need, give it a try 😉\n\n`Gallery` has 3 tabs with easy navigation through swipe gesture\n\n- Images: select albums and images. Handle selection with hightlighted numbers so your users don't forget the order\n- Camera: your photographer skill goes here\n- Videos: display all videos and select. For now the use case is to select one video at a time\n\nAnd, it has zero dependencies 😎\n\n## Usage\n\n### Presenting\n\n`GalleryController` is the main entry point, just instantiate and give it the delegate\n\n```swift\nlet gallery = GalleryController()\ngallery.delegate = self\npresent(gallery, animated: true, completion: nil)\n```\n\nThe content controller is not loaded until the users navigate to, which offers a much faster experience.\n\n### Delegate\n\nThe `GalleryControllerDelegate` requires you to implement some delegate methods in order to interact with the picker\n\n```swift\nfunc galleryController(_ controller: GalleryController, didSelectImages images: [Image])\nfunc galleryController(_ controller: GalleryController, didSelectVideo video: Video)\nfunc galleryController(_ controller: GalleryController, requestLightbox images: [Image])\nfunc galleryControllerDidCancel(_ controller: GalleryController)\n```\n\nThe lightbox delegate method is your chance to display selected images. If you're looking for a nice solution, here is the [Lightbox](https://github.com/hyperoslo/Lightbox) that we use and love\n\n### Resolving\n\nThe delegate methods give you `Image` and `Video`, which are just wrappers around `PHAsset`. To get the actual asset informations, we offer many convenient methods. See [example](https://github.com/hyperoslo/Gallery/blob/master/Example/GalleryDemo/GalleryDemo/Sources/ViewController.swift)\n\n`Image`\n\n  - Use instance method `resolve` to get the actual UIImage\n  - Use static method `Image.resolve` to resolve a list of images\n\n`Video`\n\n  - Use instance method `fetchDuration`, `fetchPlayerItem`, `fetchAVAsset`, `fetchThumbnail` to get more information about the selected video.\n\n### Permission\n\n`Gallery` handles permissions for you. It checks and askes for photo and camera usage permissions at first launch. As of iOS 10, we need to explicitly declare usage descriptions in plist files\n\n```xml\n\u003ckey\u003eNSCameraUsageDescription\u003c/key\u003e\n\u003cstring\u003eThis app requires access to camera\u003c/string\u003e\n\u003ckey\u003eNSPhotoLibraryUsageDescription\u003c/key\u003e\n\u003cstring\u003eThis app requires access to photo library\u003c/string\u003e\n```\n\n### Configuration\n\nThere are lots of customization points in `Config` structs. For example\n\n```swift\nConfig.Permission.image = UIImage(named: ImageList.Gallery.cameraIcon)\nConfig.Font.Text.bold = UIFont(name: FontList.OpenSans.bold, size: 14)!\nConfig.Camera.recordLocation = true\nConfig.tabsToShow = [.imageTab, .cameraTab]\n```\n\n### Video Editor\n\n`Gallery` cares more about video with its editing functionalities. We have `VideoEditor` and `AdvancedVideoEditor` to trim, resize, scale and define quality of the selected video\n\n```swift\nfunc galleryController(_ controller: GalleryController, didSelectVideo video: Video) {\n  controller.dismiss(animated: true, completion: nil)\n\n  let editor = VideoEditor()\n  editor.edit(video: video) { (editedVideo: Video?, tempPath: URL?) in\n    DispatchQueue.main.async {\n      if let tempPath = tempPath {\n        let controller = AVPlayerViewController()\n        controller.player = AVPlayer(url: tempPath)\n\n        self.present(controller, animated: true, completion: nil)\n      }\n    }\n  }\n}\n```\n\nWith the `Video` object, you can `fetchPlayerItem`, `fetchAVAsset` and `fetchThumbnail` as well\n\nAnd, of course, you have the ability to customize it\n\n```swift\nConfig.VideoEditor.maximumDuration = 30\nConfig.VideoEditor.savesEditedVideoToLibrary = true\n```\n\n## Installation\n\n**Gallery** is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'Gallery'\n```\n\n**Gallery** is also available through [Carthage](https://github.com/Carthage/Carthage).\nTo install just write into your Cartfile:\n\n```ruby\ngithub \"hyperoslo/Gallery\"\n```\n\n**Gallery** can also be installed manually. Just download and drop `Sources` folders in your project.\n\n## Author\n\nHyper Interaktiv AS, ios@hyper.no\n\n## Contributing\n\nWe would love you to contribute to **Gallery**, check the [CONTRIBUTING](https://github.com/hyperoslo/Gallery/blob/master/CONTRIBUTING.md) file for more info.\n\n## License\n\n**Gallery** is available under the MIT license. See the [LICENSE](https://github.com/hyperoslo/Gallery/blob/master/LICENSE.md) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperoslo%2Fgallery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperoslo%2Fgallery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperoslo%2Fgallery/lists"}