Skip to content
Reactive extension for the Kingfisher image downloading and caching library
Branch: master
Clone or download
ppth0608 and freak4pc Minor code cleanups
- Inference of return type
- Change the order of .success, .failure events of single trait
Latest commit 30659c9 Mar 16, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Update CI to drop Swift 4 support Mar 1, 2019
Configs
Example Additional Kingfisher 5 update cleanups Mar 1, 2019
Images
RxKingfisher.xcodeproj Update CI to drop Swift 4 support Mar 1, 2019
Sources Minor code cleanups Mar 15, 2019
Tests
scripts
.gitignore Example project May 10, 2018
CHANGELOG.md CHANGELOG 0.5.0 Mar 7, 2019
Cartfile
Cartfile.resolved Support Kingfisher 5.x Jan 9, 2019
LICENSE Logo and basic README May 9, 2018
README.md
RxKingfisher.podspec

README.md

RxKingfisher

RxKingfisher is a Reactive Extension for Kingfisher - a lightweight, pure-Swift library for downloading and caching images from the web.

RxKingfisher Example

It provides Reactive Extensions on top of Kingfisher's .kf namespace, via .kf.rx and introduces two main usages:

Bind URL to Image View

Every Image view supports two different options for binding a URL to an Image view.

optionSelected // Observable<URL>
    .bind(to: image.kf.rx.image(options: [.transition(.fade(0.2))])
    .disposed(by: disposeBag)

OR

optionSelected
    .flatMap { url in imageView.kf.rx.setImage(with: url, options: [.transition(.fade(0.2))]) }
    .subscribe(onNext: { image in
        print("Image successfully loaded and set on Image view: \(image)")
    })
    .disposed(by: disposeBag)

Retrieve an Image without an Image View

Every KingfisherManager supports fetching an image from a URL, returning a Single<Image>:

tappedButton
    .flatMapLatest { KingfisherManager.shared.rx.retrieveImage(with: urlToImage) }
    .subscribe(onNext: { image in
        print("Image successfully loaded: \(image)")
    })
    .disposed(by: disposeBag)

License

RxKingfisher is released under the MIT license. See LICENSE for details.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.