Created
November 12, 2018 04:35
-
-
Save liuzhida33/7fd12294396388e9a542a9cd40136327 to your computer and use it in GitHub Desktop.
WKWebview 添加loading和estimatedProgress rx属性
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
extension Reactive where Base: WKWebView { | |
var loading: Observable<Bool> { | |
return observeWeakly(Bool.self, "loading", options: [.initial, .new]).map { $0 ?? false } | |
} | |
var estimatedProgress: Observable<Double> { | |
return observeWeakly(Double.self, "estimatedProgress").map { $0 ?? 0 } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment