RxUnsplashSource 0.1.1

RxUnsplashSource 0.1.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release May 2016
SPMSupports SPM

Maintained by muukii, muukii.



RxUnsplashSource

Get photo form Unsplash Source with RxSwift

Basic Usage

  • Get random photo
RxUnsplashSource.random(size: UIScreen.mainScreen().bounds.size)
    .bindTo(imageView.rx_image)
  • Get random photo from category
RxUnsplashSource
    .random(
        category: .Food,     
        size: UIScreen.mainScreen().bounds.size
    )
    .bindTo(imageView.rx_image)

Advanced Usage

  • Change the image every minute
Observable<Int>
    .interval(60, scheduler: SerialDispatchQueueScheduler(globalConcurrentQueueQOS: .Default))
    .startWith(0)
    .flatMap { _ in RxUnsplashSource.random(size: UIScreen.mainScreen().bounds.size) }
    .bindTo(imageView.rx_image)

Installation

pod "RxUnsplashSource"

Author

muukii, [email protected]

License

RxUnsplashSource is available under the MIT license. See the LICENSE file for more info.