{"id":1500,"url":"https://github.com/hyperoslo/Lightbox","last_synced_at":"2025-08-06T13:32:42.138Z","repository":{"id":34381391,"uuid":"38307869","full_name":"hyperoslo/Lightbox","owner":"hyperoslo","description":":milky_way: A convenient and easy to use image viewer for your iOS app","archived":false,"fork":false,"pushed_at":"2024-08-12T05:42:32.000Z","size":6180,"stargazers_count":1622,"open_issues_count":24,"forks_count":328,"subscribers_count":39,"default_branch":"master","last_synced_at":"2024-08-17T06:02:05.653Z","etag":null,"topics":["image","ios","lightbox","presentation","swift"],"latest_commit_sha":null,"homepage":"https://www.hyper.no","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-30T12:28:01.000Z","updated_at":"2024-08-16T16:53:00.000Z","dependencies_parsed_at":"2022-08-08T01:00:17.649Z","dependency_job_id":"ce3fab13-6619-4b49-89ef-5c8d8c026e08","html_url":"https://github.com/hyperoslo/Lightbox","commit_stats":{"total_commits":498,"total_committers":37,"mean_commits":13.45945945945946,"dds":0.6465863453815262,"last_synced_commit":"398ee143f00bfc070023c155e6d088ffb399c8cb"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2FLightbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2FLightbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2FLightbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2FLightbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperoslo","download_url":"https://codeload.github.com/hyperoslo/Lightbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215780271,"owners_count":15929791,"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":["image","ios","lightbox","presentation","swift"],"created_at":"2024-01-05T20:15:47.918Z","updated_at":"2024-08-17T16:30:52.856Z","avatar_url":"https://github.com/hyperoslo.png","language":"Swift","funding_links":[],"categories":["Media","Libs","ImageView","UI","Images [🔝](#readme)","Swift"],"sub_categories":["Image","Images","Other free courses"],"readme":"# Lightbox\n\n[![CI Status](https://circleci.com/gh/hyperoslo/Lightbox.png)](https://circleci.com/gh/hyperoslo/Lightbox)\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/Lightbox.svg?style=flat)](http://cocoadocs.org/docsets/Lightbox)\n[![Platform](https://img.shields.io/cocoapods/p/Lightbox.svg?style=flat)](http://cocoadocs.org/docsets/Lightbox)\n![Swift](https://img.shields.io/badge/%20in-swift%204.0-orange.svg)\n\n\u003cimg src=\"https://raw.githubusercontent.com/hyperoslo/Lightbox/master/Images/Icon.png\" alt=\"Lightbox Icon\" align=\"right\" /\u003e\n\n**Lightbox** is a convenient and easy to use image viewer for your iOS app,\npacked with all the features you expect:\n\n- [x] Paginated image slideshow.\n- [x] Video support.\n- [x] Double-tap to zoom.\n- [x] Image caption.\n- [x] Dynamic background based on [Hue](https://github.com/hyperoslo/Hue)\n- [x] Remote image loading and caching based on [Imaginary](https://github.com/hyperoslo/Imaginary)\n- [x] Interactive transition animations.\n- [x] Powerful configuration.\n- [x] [Live Demo](https://appetize.io/app/wfgwc2uvg82m9pzbt17p4rrgh4?device=iphone5s\u0026scale=75\u0026orientation=portrait\u0026osVersion=9.3)\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"Images/demo.png\" height=\"500\"\u003e\n\u003cimg src=\"Images/demo2.png\" height=\"500\"\u003e\n\u003c/div\u003e\n\n## Table of Contents\n\n* [Usage](#usage)\n  * [Controller](#controller)\n  * [Delegates](#delegates)\n  * [Image loading](#image-loading)\n  * [Video](#video)\n  * [Configuration](#configuration)\n* [Installation](#installation)\n* [Author](#author)\n* [Contributing](#contributing)\n* [License](#license)\n\n## Usage\n\n### Controller\n\nTo start your slideshow just instantiate `LightboxController`, set needed\ndelegates and present it:\n\n\n```swift\n\n// Create an array of images.\nlet images = [\n  LightboxImage(imageURL: URL(string: \"https://cdn.arstechnica.net/2011/10/05/iphone4s_sample_apple-4e8c706-intro.jpg\")!),\n  LightboxImage(\n    image: UIImage(named: \"photo1\")!,\n    text: \"This is an example of a remote image loaded from URL\"\n  ),\n  LightboxImage(\n    image: UIImage(named: \"photo2\")!,\n    text: \"\",\n    videoURL: URL(string: \"https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4\")\n  ),\n  LightboxImage(\n    image: UIImage(named: \"photo3\")!,\n    text: \"This is an example of a local image.\"\n  )\n]\n\n// Create an instance of LightboxController.\nlet controller = LightboxController(images: images)\n\n// Set delegates.\ncontroller.pageDelegate = self\ncontroller.dismissalDelegate = self\n\n// Use dynamic background.\ncontroller.dynamicBackground = true\n\n// Present your controller.\npresent(controller, animated: true, completion: nil)\n```\n\n### Delegates\n\nUse `LightboxControllerPageDelegate` if you want to be notified about page\nnavigation changes.\n\n```swift\nextension ViewController: LightboxControllerPageDelegate {\n\n  func lightboxController(_ controller: LightboxController, didMoveToPage page: Int) {\n    print(page)\n  }\n}\n```\n\nUse `LightboxControllerDismissalDelegate` to be notified when controller is\nabout to be dismissed. Please note that `LightboxController` dismisses itself\nif it was presented initially.\n\n```swift\nextension ViewController: LightboxControllerDismissalDelegate: class {\n\n  func lightboxControllerWillDismiss(_ controller: LightboxController) {\n    // ...\n  }\n}\n```\n\n### Image loading\n\nBy default images are loaded using [Imaginary](https://github.com/hyperoslo/Imaginary) for reliable loading and caching. But it's easy to change this behavior using **LightboxConfig**\n\n```swift\nLightboxConfig.loadImage = {\n  imageView, URL, completion in\n  // Custom image loading\n}\n```\n\n### Video\n\n**Lightbox** can show and plays video using default `AVPlayerViewController`. Showning video by using `videoURL`:\n\n```swift\nLightboxImage(\n  image: UIImage(named: \"photo2\")!,\n  text: \"\",\n  videoURL: NSURL(string: \"https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4\")\n)\n```\n\nOverride video handling if needed:\n\n```swift\nLightboxConfig.handleVideo = { from, videoURL in\n  // Custom video handling\n  let videoController = AVPlayerViewController()\n  videoController.player = AVPlayer(url: videoURL)\n\n  from.present(videoController, animated: true) {\n    videoController.player?.play()\n  }\n}\n```\n\n### Configuration\n\nConfigure text, colors, fonts of UI elements by overriding the static\nvariables in the **Lightbox** [configuration](https://github.com/hyperoslo/Lightbox/blob/master/Source/LightboxConfig.swift) struct. As an example:\n\n```swift\nLightboxConfig.CloseButton.image = UIImage(named: ImageList.Lightbox.closeButton)\nLightboxConfig.CloseButton.textAttributes = TextAttributes.Lightbox.closeButton\nLightboxConfig.CloseButton.text = \"Finish\"\n\nLightboxConfig.DeleteButton.image = UIImage(named: ImageList.Lightbox.deleteButton)\nLightboxConfig.DeleteButton.textAttributes = TextAttributes.Lightbox.deleteButton\nLightboxConfig.DeleteButton.text = \"Delete\"\n\nLightboxConfig.InfoLabel.ellipsisText = \"Show more\"\n```\n\n## Installation\n\n**Lightbox** is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'Lightbox'\n```\n\nIn order to quickly try the demo project of a **Lightbox** just run\n`pod try Lightbox` in your terminal.\n\n**Lightbox** is also available through [Carthage](https://github.com/Carthage/Carthage).\nTo install just write into your Cartfile:\n\n```ruby\ngithub \"hyperoslo/Lightbox\"\n```\n\nTo install **Lightbox** manually just download and drop `Sources` and\n`Images` 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 **Lightbox**, check the [CONTRIBUTING](https://github.com/hyperoslo/Lightbox/blob/master/CONTRIBUTING.md) file for more info.\n\n## License\n\n**Lightbox** is available under the MIT license. See the [LICENSE](https://github.com/hyperoslo/Lightbox/blob/master/LICENSE.md) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperoslo%2FLightbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperoslo%2FLightbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperoslo%2FLightbox/lists"}