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 Link To Documentation.
- Support
CocoaPods
andSPM
. - Support
AVAssetResourceLoaderDelegate
.
Platform | Minimum Swift Version | Minimum Swift Tools Version | Installation | Status |
---|---|---|---|---|
iOS 13.0+ | 5.0 | 5.5 | SPM | Tested |
iOS 13.0+ | 5.0 | 5.5 | CocoaPods | Tested |
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler.
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 Package.swift
.
dependencies: [
.package(url: "https://github.com/divar-ir/DarkRoom.git", .upToNextMajor(from: "1.0.0"))
]
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate DarkRoom into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'DarkRoom'
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
DarkRoomImageLoader
and passing it toDarkRoomCarouselViewController
initializer.
In case you are using CollectionView to open
DarkRoomCarouselViewController
and the datasource is shared, consider providinginitialIndex
, 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.