Skip to content
Snippets Groups Projects
Commit 5e442943 authored by Silbino Goncalves Matado's avatar Silbino Goncalves Matado
Browse files

Bump RxSwift version + fix depracated methods warnings

Change-Id: I09f77c6fda83a1d24063fc4e1e4e9110b65e37d9
parent 497b2005
Branches
Tags
No related merge requests found
github "ReactiveX/RxSwift" == 3.0.1 github "ReactiveX/RxSwift"
github "RxSwiftCommunity/RxDataSources" ~> 1.0 github "RxSwiftCommunity/RxDataSources" == 1.0.3
github "pkluz/PKHUD" ~> 4.0 github "pkluz/PKHUD"
github "ReactiveX/RxSwift" "3.0.1" github "ReactiveX/RxSwift" "3.5.0"
github "RxSwiftCommunity/RxDataSources" "1.0.3" github "RxSwiftCommunity/RxDataSources" "1.0.3"
github "pkluz/PKHUD" "4.2.3" github "pkluz/PKHUD" "4.2.3"
...@@ -53,8 +53,8 @@ class SmartlistViewController: UIViewController, UITableViewDelegate { ...@@ -53,8 +53,8 @@ class SmartlistViewController: UIViewController, UITableViewDelegate {
self.tableView.register(UINib.init(nibName: "ConversationCell", bundle: nil), forCellReuseIdentifier: "ConversationCellId") self.tableView.register(UINib.init(nibName: "ConversationCell", bundle: nil), forCellReuseIdentifier: "ConversationCellId")
//Bind the TableView to the ViewModel //Bind the TableView to the ViewModel
self.viewModel.conversationsObservable.bindTo(tableView.rx.items(cellIdentifier: "ConversationCellId", cellType: ConversationCell.self) ) { index, viewModel, cell in self.viewModel.conversationsObservable.bind(to: tableView.rx.items(cellIdentifier: "ConversationCellId", cellType: ConversationCell.self) ) { index, viewModel, cell in
viewModel.userName.bindTo(cell.nameLabel.rx.text).addDisposableTo(self.disposeBag) viewModel.userName.bind(to: cell.nameLabel.rx.text).addDisposableTo(self.disposeBag)
cell.newMessagesLabel.text = viewModel.unreadMessages cell.newMessagesLabel.text = viewModel.unreadMessages
cell.lastMessageDateLabel.text = viewModel.lastMessageReceivedDate cell.lastMessageDateLabel.text = viewModel.lastMessageReceivedDate
cell.newMessagesIndicator.isHidden = !viewModel.hasUnreadMessages cell.newMessagesIndicator.isHidden = !viewModel.hasUnreadMessages
......
...@@ -115,7 +115,7 @@ class CreateRingAccountViewController: UITableViewController { ...@@ -115,7 +115,7 @@ class CreateRingAccountViewController: UITableViewController {
//Enables create account button //Enables create account button
self.mAccountViewModel.canCreateAccount self.mAccountViewModel.canCreateAccount
.bindTo(self.mCreateAccountButton.rx.isEnabled) .bind(to: self.mCreateAccountButton.rx.isEnabled)
.addDisposableTo(mDisposeBag) .addDisposableTo(mDisposeBag)
} }
...@@ -212,7 +212,7 @@ class CreateRingAccountViewController: UITableViewController { ...@@ -212,7 +212,7 @@ class CreateRingAccountViewController: UITableViewController {
comment: "") comment: "")
cell.titleLabel.textColor = .white cell.titleLabel.textColor = .white
_ = cell.registerSwitch.rx.value.bindTo(self.mAccountViewModel.registerUsername) _ = cell.registerSwitch.rx.value.bind(to: self.mAccountViewModel.registerUsername)
.addDisposableTo(mDisposeBag) .addDisposableTo(mDisposeBag)
return cell return cell
...@@ -228,7 +228,7 @@ class CreateRingAccountViewController: UITableViewController { ...@@ -228,7 +228,7 @@ class CreateRingAccountViewController: UITableViewController {
_ = cell.textField.rx.text.orEmpty _ = cell.textField.rx.text.orEmpty
.throttle(textFieldThrottlingDuration, scheduler: MainScheduler.instance) .throttle(textFieldThrottlingDuration, scheduler: MainScheduler.instance)
.distinctUntilChanged() .distinctUntilChanged()
.bindTo(self.mAccountViewModel.username) .bind(to: self.mAccountViewModel.username)
.addDisposableTo(mDisposeBag) .addDisposableTo(mDisposeBag)
//Switch to new password cell when return button is touched //Switch to new password cell when return button is touched
...@@ -237,7 +237,7 @@ class CreateRingAccountViewController: UITableViewController { ...@@ -237,7 +237,7 @@ class CreateRingAccountViewController: UITableViewController {
}).addDisposableTo(mDisposeBag) }).addDisposableTo(mDisposeBag)
_ = self.mAccountViewModel.usernameValidationMessage _ = self.mAccountViewModel.usernameValidationMessage
.bindTo(cell.errorMessageLabel.rx.text) .bind(to: cell.errorMessageLabel.rx.text)
.addDisposableTo(mDisposeBag) .addDisposableTo(mDisposeBag)
return cell return cell
...@@ -261,11 +261,11 @@ class CreateRingAccountViewController: UITableViewController { ...@@ -261,11 +261,11 @@ class CreateRingAccountViewController: UITableViewController {
comment: "") comment: "")
//Binds the password field value to the ViewModel //Binds the password field value to the ViewModel
_ = cell.textField.rx.text.orEmpty.bindTo(self.mAccountViewModel.password) _ = cell.textField.rx.text.orEmpty.bind(to: self.mAccountViewModel.password)
.addDisposableTo(mDisposeBag) .addDisposableTo(mDisposeBag)
//Binds the observer to show the error label if the field is not empty //Binds the observer to show the error label if the field is not empty
_ = self.mAccountViewModel.hidePasswordError.bindTo(cell.errorMessageLabel.rx.isHidden) _ = self.mAccountViewModel.hidePasswordError.bind(to: cell.errorMessageLabel.rx.isHidden)
.addDisposableTo(mDisposeBag) .addDisposableTo(mDisposeBag)
//Switch to the repeat pasword cell when return button is touched //Switch to the repeat pasword cell when return button is touched
...@@ -288,11 +288,11 @@ class CreateRingAccountViewController: UITableViewController { ...@@ -288,11 +288,11 @@ class CreateRingAccountViewController: UITableViewController {
comment: "") comment: "")
//Binds the repeat password field value to the ViewModel //Binds the repeat password field value to the ViewModel
_ = cell.textField.rx.text.orEmpty.bindTo(self.mAccountViewModel.repeatPassword) _ = cell.textField.rx.text.orEmpty.bind(to: self.mAccountViewModel.repeatPassword)
.addDisposableTo(mDisposeBag) .addDisposableTo(mDisposeBag)
//Binds the observer to the text field 'hidden' property //Binds the observer to the text field 'hidden' property
_ = self.mAccountViewModel.hideRepeatPasswordError.bindTo(cell.errorMessageLabel.rx.isHidden) _ = self.mAccountViewModel.hideRepeatPasswordError.bind(to: cell.errorMessageLabel.rx.isHidden)
.addDisposableTo(mDisposeBag) .addDisposableTo(mDisposeBag)
return cell return cell
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment