From 5e442943accfc7cf1ef4015b9f6332d585f8596b Mon Sep 17 00:00:00 2001
From: Silbino Goncalves Matado <silbino.gmatado@savoirfairelinux.com>
Date: Tue, 20 Jun 2017 10:44:44 -0400
Subject: [PATCH] Bump RxSwift version + fix depracated methods warnings

Change-Id: I09f77c6fda83a1d24063fc4e1e4e9110b65e37d9
---
 Ring/Cartfile                                    |  6 +++---
 Ring/Cartfile.resolved                           |  2 +-
 Ring/Ring/SmartlistViewController.swift          |  4 ++--
 .../CreateRingAccountViewController.swift        | 16 ++++++++--------
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/Ring/Cartfile b/Ring/Cartfile
index e336d1898..7848fe142 100644
--- a/Ring/Cartfile
+++ b/Ring/Cartfile
@@ -1,3 +1,3 @@
-github "ReactiveX/RxSwift" == 3.0.1
-github "RxSwiftCommunity/RxDataSources" ~> 1.0
-github "pkluz/PKHUD" ~> 4.0
+github "ReactiveX/RxSwift"
+github "RxSwiftCommunity/RxDataSources" == 1.0.3
+github "pkluz/PKHUD"
diff --git a/Ring/Cartfile.resolved b/Ring/Cartfile.resolved
index 306fc01f4..318af5d1b 100644
--- a/Ring/Cartfile.resolved
+++ b/Ring/Cartfile.resolved
@@ -1,3 +1,3 @@
-github "ReactiveX/RxSwift" "3.0.1"
+github "ReactiveX/RxSwift" "3.5.0"
 github "RxSwiftCommunity/RxDataSources" "1.0.3"
 github "pkluz/PKHUD" "4.2.3"
diff --git a/Ring/Ring/SmartlistViewController.swift b/Ring/Ring/SmartlistViewController.swift
index 9a76c1117..0768bdf02 100644
--- a/Ring/Ring/SmartlistViewController.swift
+++ b/Ring/Ring/SmartlistViewController.swift
@@ -53,8 +53,8 @@ class SmartlistViewController: UIViewController, UITableViewDelegate {
         self.tableView.register(UINib.init(nibName: "ConversationCell", bundle: nil), forCellReuseIdentifier: "ConversationCellId")
 
         //Bind the TableView to the ViewModel
-        self.viewModel.conversationsObservable.bindTo(tableView.rx.items(cellIdentifier: "ConversationCellId", cellType: ConversationCell.self) ) { index, viewModel, cell in
-            viewModel.userName.bindTo(cell.nameLabel.rx.text).addDisposableTo(self.disposeBag)
+        self.viewModel.conversationsObservable.bind(to: tableView.rx.items(cellIdentifier: "ConversationCellId", cellType: ConversationCell.self) ) { index, viewModel, cell in
+            viewModel.userName.bind(to: cell.nameLabel.rx.text).addDisposableTo(self.disposeBag)
             cell.newMessagesLabel.text = viewModel.unreadMessages
             cell.lastMessageDateLabel.text = viewModel.lastMessageReceivedDate
             cell.newMessagesIndicator.isHidden = !viewModel.hasUnreadMessages
diff --git a/Ring/Ring/Walkthrough/CreateRingAccountViewController.swift b/Ring/Ring/Walkthrough/CreateRingAccountViewController.swift
index e3ac20563..290bc22b0 100644
--- a/Ring/Ring/Walkthrough/CreateRingAccountViewController.swift
+++ b/Ring/Ring/Walkthrough/CreateRingAccountViewController.swift
@@ -115,7 +115,7 @@ class CreateRingAccountViewController: UITableViewController {
 
         //Enables create account button
         self.mAccountViewModel.canCreateAccount
-            .bindTo(self.mCreateAccountButton.rx.isEnabled)
+            .bind(to: self.mCreateAccountButton.rx.isEnabled)
             .addDisposableTo(mDisposeBag)
     }
 
@@ -212,7 +212,7 @@ class CreateRingAccountViewController: UITableViewController {
                                                      comment: "")
             cell.titleLabel.textColor = .white
 
-            _ = cell.registerSwitch.rx.value.bindTo(self.mAccountViewModel.registerUsername)
+            _ = cell.registerSwitch.rx.value.bind(to: self.mAccountViewModel.registerUsername)
                 .addDisposableTo(mDisposeBag)
 
             return cell
@@ -228,7 +228,7 @@ class CreateRingAccountViewController: UITableViewController {
             _ = cell.textField.rx.text.orEmpty
                 .throttle(textFieldThrottlingDuration, scheduler: MainScheduler.instance)
                 .distinctUntilChanged()
-                .bindTo(self.mAccountViewModel.username)
+                .bind(to: self.mAccountViewModel.username)
                 .addDisposableTo(mDisposeBag)
 
             //Switch to new password cell when return button is touched
@@ -237,7 +237,7 @@ class CreateRingAccountViewController: UITableViewController {
             }).addDisposableTo(mDisposeBag)
 
             _ = self.mAccountViewModel.usernameValidationMessage
-                .bindTo(cell.errorMessageLabel.rx.text)
+                .bind(to: cell.errorMessageLabel.rx.text)
                 .addDisposableTo(mDisposeBag)
 
             return cell
@@ -261,11 +261,11 @@ class CreateRingAccountViewController: UITableViewController {
                                                             comment: "")
 
             //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)
 
             //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)
 
             //Switch to the repeat pasword cell when return button is touched
@@ -288,11 +288,11 @@ class CreateRingAccountViewController: UITableViewController {
                                                             comment: "")
 
             //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)
 
             //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)
 
             return cell
-- 
GitLab