RxUnsplashSource 0.1.1

RxUnsplashSource 0.1.1

测试已测试
Lang语言 SwiftSwift
许可证 MIT
发布最后发布2016 年 5 月
SPM支持 SPM

muukiimuukii 维护。



RxUnsplashSource

使用 Unsplash SourceRxSwift 获取照片

基本用法

  • 获取随机照片
RxUnsplashSource.random(size: UIScreen.mainScreen().bounds.size)
    .bindTo(imageView.rx_image)
  • 获取特定类别的随机照片
RxUnsplashSource
    .random(
        category: .Food,     
        size: UIScreen.mainScreen().bounds.size
    )
    .bindTo(imageView.rx_image)

高级用法

  • 每分钟更改一次图片
Observable<Int>
    .interval(60, scheduler: SerialDispatchQueueScheduler(globalConcurrentQueueQOS: .Default))
    .startWith(0)
    .flatMap { _ in RxUnsplashSource.random(size: UIScreen.mainScreen().bounds.size) }
    .bindTo(imageView.rx_image)

安装

pod "RxUnsplashSource"

作者

muukii,[email protected]

许可证

RxUnsplashSource 适用于 MIT 许可证。有关更多信息,请参阅 LICENSE 文件。