Lightbox alternatives and similar libraries
Based on the "Images" category.
Alternatively, view Lightbox alternatives based on common mentions on social networks and blogs.
-
SDWebImage
Asynchronous image downloader with cache support as a UIImageView category -
SwiftGen-Assets
A tool to auto-generate Swift enums for all your UIImages from your Assets Catalogs. -
Nuke
Advanced pure Swift framework for loading, caching, processing, displaying and preheating images. -
HanekeSwift
A lightweight generic cache for iOS written in Swift with extra love for images. -
GPUImage 2
GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing. -
SkyFloatingLabelTextField
A beautiful and flexible text field control implementation of "Float Label Pattern". -
AlamofireImage
AlamofireImage is an image component library for Alamofire. -
GPUImage 3
GPUImage 3 is a BSD-licensed framework for GPU-accelerated video and image processing using Metal. -
APNGKit
High performance and delightful way to play with APNG format in iOS. -
SwiftSVG
A single pass SVG parser with multiple interface options (String, NS/UIBezierPath, CAShapeLayer, and NS/UIView) -
TinyCrayon
A smart and easy-to-use image masking and cutout SDK for mobile apps. -
CTPanoramaView
A library that displays spherical or cylindrical panoramas with touch or motion based controls. -
AXPhotoViewer
An iPhone/iPad photo gallery viewer, useful for viewing a large (or small!) number of photos. -
FMPhotoPicker
A modern, simple and zero-dependency photo picker with an elegant and customizable image editor -
PassportScanner
Scan the MRZ code of a passport and extract the first name, last name, passport number, nationality, date of birth, expiration date and personal number. -
XAnimatedImage
XAnimatedImage is a performant animated GIF engine for iOS written in Swift based on FLAnimatedImage -
Viewer
Image viewer (or Lightbox) with support for local and remote videos and images. -
UIImageView-BetterFace-Swift
autoresize images and if any face discovered refine the position of the image. -
JLStickerTextView
A UIImageView allow you to add multiple Label (multiple line text support) on it, you can edit, rotate, resize the Label as you want with one finger ,then render the text on Image. -
KFSwiftImageLoader
An extremely high-performance, lightweight, and energy-efficient pure Swift async web image loader with memory and disk caching for iOS and Watch. -
Moa
An image download extension of the image view for iOS, tvOS and macOS. -
MCScratchImageView
A custom ImageView that is used to cover the surface of other view like a scratch card, user can swipe the mulch to see the view below -
ImageLoader
A lightweight and fast image loader for iOS written in Swift. -
ImageDetect
Detect and crop faces, barcodes and texts in image with iOS 11 Vision API. -
FacebookImagePicker
Facebook album photo picker written in Swift. -
DTPhotoViewerController
A fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer. -
Kanvas
A iOS library for adding effects, drawings, text, stickers, and making GIFs from existing media or the camera. -
LetterAvatarKit
A UIImage extension that generates letter-based avatars. -
PASImageView
async remote download your image and round them. automatically. -
ATGMediaBrowser
Image slide-show viewer with multiple predefined transition styles, and with ability to create new transitions with ease.
Scout APM - Leading-edge performance monitoring starting at $39/month
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of Lightbox or a related project?
README
Lightbox
Lightbox is a convenient and easy to use image viewer for your iOS app, packed with all the features you expect:
- [x] Paginated image slideshow.
- [x] Video support.
- [x] Double-tap to zoom.
- [x] Image caption.
- [x] Dynamic background based on Hue
- [x] Remote image loading and caching based on Imaginary
- [x] Interactive transition animations.
- [x] Powerful configuration.
- [x] Live Demo
Table of Contents
Usage
Controller
To start your slideshow just instantiate LightboxController
, set needed
delegates and present it:
// Create an array of images.
let images = [
LightboxImage(imageURL: URL(string: "https://cdn.arstechnica.net/2011/10/05/iphone4s_sample_apple-4e8c706-intro.jpg")!),
LightboxImage(
image: UIImage(named: "photo1")!,
text: "This is an example of a remote image loaded from URL"
),
LightboxImage(
image: UIImage(named: "photo2")!,
text: "",
videoURL: URL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
),
LightboxImage(
image: UIImage(named: "photo3")!,
text: "This is an example of a local image."
)
]
// Create an instance of LightboxController.
let controller = LightboxController(images: images)
// Set delegates.
controller.pageDelegate = self
controller.dismissalDelegate = self
// Use dynamic background.
controller.dynamicBackground = true
// Present your controller.
present(controller, animated: true, completion: nil)
Delegates
Use LightboxControllerPageDelegate
if you want to be notified about page
navigation changes.
extension ViewController: LightboxControllerPageDelegate {
func lightboxController(_ controller: LightboxController, didMoveToPage page: Int) {
print(page)
}
}
Use LightboxControllerDismissalDelegate
to be notified when controller is
about to be dismissed. Please note that LightboxController
dismisses itself
if it was presented initially.
extension ViewController: LightboxControllerDismissalDelegate: class {
func lightboxControllerWillDismiss(_ controller: LightboxController) {
// ...
}
}
Image loading
By default images are loaded using Imaginary for reliable loading and caching. But it's easy to change this behavior using LightboxConfig
LightboxConfig.loadImage = {
imageView, URL, completion in
// Custom image loading
}
Video
Lightbox can show and plays video using default AVPlayerViewController
. Showning video by using videoURL
:
LightboxImage(
image: UIImage(named: "photo2")!,
text: "",
videoURL: NSURL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
)
Override video handling if needed:
LightboxConfig.handleVideo = { from, videoURL in
// Custom video handling
let videoController = AVPlayerViewController()
videoController.player = AVPlayer(url: videoURL)
from.present(videoController, animated: true) {
videoController.player?.play()
}
}
Configuration
Configure text, colors, fonts of UI elements by overriding the static variables in the Lightbox configuration struct. As an example:
LightboxConfig.CloseButton.image = UIImage(named: ImageList.Lightbox.closeButton)
LightboxConfig.CloseButton.textAttributes = TextAttributes.Lightbox.closeButton
LightboxConfig.CloseButton.text = "Finish"
LightboxConfig.DeleteButton.image = UIImage(named: ImageList.Lightbox.deleteButton)
LightboxConfig.DeleteButton.textAttributes = TextAttributes.Lightbox.deleteButton
LightboxConfig.DeleteButton.text = "Delete"
LightboxConfig.InfoLabel.ellipsisText = "Show more"
Installation
Lightbox is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Lightbox'
In order to quickly try the demo project of a Lightbox just run
pod try Lightbox
in your terminal.
Lightbox is also available through Carthage. To install just write into your Cartfile:
github "hyperoslo/Lightbox"
To install Lightbox manually just download and drop Sources
and
Images
folders in your project.
Author
Hyper Interaktiv AS, [email protected]
Contributing
We would love you to contribute to Lightbox, check the CONTRIBUTING file for more info.
License
Lightbox is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the Lightbox README section above
are relevant to that project's source code only.