RxWebKit is a RxSwift wrapper for WebKit
.
// MARK: Setup WKWebView
let webView = WKWebView(frame: self.view.bounds)
self.view.addSubview(webView)
// MARK: Observing properties
webView.rx.title
.subscribe(onNext: {
print("title: \($0)")
})
.disposed(by: disposeBag)
webView.rx.url
.subscribe(onNext: {
print("URL: \($0)")
})
.disposed(by: disposeBag)
Add to Podfile
:
pod 'RxWebKit'
Add to Cartfile
:
github "RxSwiftCommunity/RxWebKit"
Run carthage update --platform iOS
Add run script build phase /usr/local/bin/carthage copy-frameworks
with input files being:
$(SRCROOT)/carthage/Build/iOS/RxWebKit.framework
RxWebKit requires Swift 4.0 and dedicated versions of RxSwift 4.0.0-beta.0
MIT