Skip to content

Commit

Permalink
Merge pull request #45 from Econa77/feature/rxswift-6
Browse files Browse the repository at this point in the history
Add support for RxSwift 6
  • Loading branch information
mRs- authored Feb 24, 2021
2 parents f800f43 + a69d756 commit a0e7271
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "ReactiveX/RxSwift" ~> 5.0
github "ReactiveX/RxSwift" ~> 6.0
6 changes: 3 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "Quick/Nimble" "v8.0.7"
github "Quick/Quick" "v2.2.0"
github "ReactiveX/RxSwift" "5.1.1"
github "Quick/Nimble" "v9.0.0"
github "Quick/Quick" "v3.0.0"
github "ReactiveX/RxSwift" "6.0.0"
2 changes: 1 addition & 1 deletion Example/FailedRequestViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FailedRequestViewController: UIViewController {

wkWebView.rx
.didFailProvisionalNavigation
.observeOn(MainScheduler.instance)
.observe(on: MainScheduler.instance)
.debug("didFailProvisionalNavigation")
.subscribe(onNext: { [weak self] webView, navigation, error in
guard let self = self else { return }
Expand Down
20 changes: 12 additions & 8 deletions Example/InvokeJSFunctionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@ class InvokeJSFunctionViewController : UIViewController {
super.viewDidLoad()
view.addSubview(webview)
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Invoke", style: .plain, target: nil, action: nil)
self.navigationItem.rightBarButtonItem?.rx.tap.bind { [weak self] in
guard let self = self else { return }
self.webview.rx.evaluateJavaScript("presentAlert()").observeOn(MainScheduler.asyncInstance).subscribe { event in
if case .next(let body) = event, let message = body as? String {
print(message)
}
}.disposed(by: self.bag)
}.disposed(by: self.bag)
self.navigationItem.rightBarButtonItem?.rx.tap
.bind { [weak self] in
guard let self = self else { return }
self.webview.rx.evaluateJavaScript("presentAlert()")
.observe(on: MainScheduler.asyncInstance)
.subscribe { event in
if case .next(let body) = event, let message = body as? String {
print(message)
}
}.disposed(by: self.bag)
}
.disposed(by: self.bag)
webview.loadHTMLString(html, baseURL: nil)
}

Expand Down
2 changes: 1 addition & 1 deletion Example/RedirectViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RedirectViewController: UIViewController {

wkWebView.rx
.didReceiveServerRedirectForProvisionalNavigation
.observeOn(MainScheduler.instance)
.observe(on: MainScheduler.instance)
.debug("didReceiveServerRedirectForProvisionalNavigation")
.subscribe(onNext: { [weak self] webView, navigation in
guard let self = self else { return }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ $(SRCROOT)/carthage/Build/iOS/RxWebKit.framework

## Requirements

RxWebKit requires Swift 5.2.2 and dedicated versions of RxSwift 5.1.1
RxWebKit requires Swift 5.2.2 and dedicated versions of RxSwift 6.0.0

## License

Expand Down
6 changes: 3 additions & 3 deletions RxWebKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/RxSwiftCommunity/RxWebKit.git", :tag => s.version.to_s }
s.source_files = "RxWebKit/Sources/**/*.{swift}"
s.exclude_files = "RxWebKit/Sources/**/*.{plist}"
s.ios.deployment_target = '8.0'
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.13'
s.swift_version = '5.0'
s.dependency 'RxSwift', '~> 5.0'
s.dependency 'RxCocoa', '~> 5.0'
s.dependency 'RxSwift', '~> 6.0'
s.dependency 'RxCocoa', '~> 6.0'
end

0 comments on commit a0e7271

Please sign in to comment.