Elegant Media Viewer Written In Swift.
- Presenting/Dismissing Images And Videos With Showy Animations.
- Play Video With Custom Control Configuration.
- Support Custom Configuration For Almost Each Component.
- Support HLS And Local Videos.
- Documented By DocC.
|Platform||Minimum Swift Version||Minimum Swift Tools Version||Installation||Status|
Swift Package Manager
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the
Once you have your Swift package set up, adding
DarkRoom as a dependency is as easy as adding it to the
dependencies value of your
dependencies: [ .package(url: "https://github.com/divar-ir/DarkRoom.git", .upToNextMajor(from: "1.0.0")) ]
We have provided one sample project in the repository. To use it clone the repo, Source files for these are in the
iOS-Example directory in project navigator. Have fun!
The Main Component is
DarkRoomCarouselViewController which you can use and provide it with datasource to show images or play videos.
Do not forget to create your own strategy of loading images by implementing
DarkRoomImageLoaderand passing it to
In case you are using CollectionView to open
DarkRoomCarouselViewControllerand the datasource is shared, consider providing
initialIndex, or the datasource will request for wrong data and causes undefined behaviors.
let carouselController = DarkRoomCarouselViewController( imageDataSource: self, imageDelegate: self, imageLoader: ImageLoaderImpl(), initialIndex: 0, configuration: DarkRoomCarouselDefaultConfiguration() ) self.present(carouselController, animated: true)
The first version of this library was inspired by ImageViewer.Swift
Feel free to share your ideas or any other problems. Pull requests are welcomed.
DarkRoom was released under an MIT license. See LICENSE for more information.