Created
August 27, 2017 15:54
-
-
Save sauravexodus/0e2906023a7eb967e0892ae103af0cab to your computer and use it in GitHub Desktop.
How to use RxNuke+Firebase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RxSwift | |
import RxCocoa | |
import RxNuke | |
import Nuke | |
// UIImageView object | |
lazy var myImageView: UIImageView = { | |
let myImageView = UIImageView() | |
myImageView.contentMode = .scaleAspectFit | |
myImageView.translatesAutoresizingMasksIntoConstraints = false | |
return myImageView | |
}() | |
let disposeBag = DisposeBag() | |
//Create a driver with your original image path reference | |
let imageDownloadDriver: Driver<Image> = Nuke.Manager.shared.loadImage(with: "/myReference/path") | |
//Drive the ui with the imageDownloadDriver | |
imageDownloadDriver.drive(myImageView.rx.image).disposed(by: disposeBag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment