diff --git a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate index b64a123..ba8ee56 100644 Binary files a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate and b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 0c096f1..3c28427 100644 --- a/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Vendoo.xcworkspace/xcuserdata/okechi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -230,7 +230,7 @@ moduleName = "Vendoo" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift" - timestampString = "494088391.775639" + timestampString = "494209191.241024" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "460" @@ -245,7 +245,7 @@ moduleName = "Vendoo" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift" - timestampString = "494088391.776282" + timestampString = "494209191.241192" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "460" @@ -278,7 +278,7 @@ moduleName = "Vendoo" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift" - timestampString = "494088391.778069" + timestampString = "494209191.241994" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "479" @@ -293,7 +293,7 @@ moduleName = "Vendoo" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift" - timestampString = "494088391.778442" + timestampString = "494209191.242121" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "481" @@ -342,7 +342,7 @@ moduleName = "Vendoo" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift" - timestampString = "494088391.780562" + timestampString = "494209191.243433" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "498" @@ -357,7 +357,7 @@ moduleName = "Vendoo" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift" - timestampString = "494088391.780713" + timestampString = "494209191.243578" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "498" @@ -372,7 +372,7 @@ moduleName = "Vendoo" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift" - timestampString = "494088391.780851" + timestampString = "494209191.24367" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "500" @@ -678,5 +678,21 @@ landmarkType = "5"> + + + + diff --git a/Vendoo/SettingsViewController.swift b/Vendoo/SettingsViewController.swift index 01fbc4e..e731b06 100644 --- a/Vendoo/SettingsViewController.swift +++ b/Vendoo/SettingsViewController.swift @@ -8,6 +8,7 @@ import UIKit import Locksmith +import FirebaseAuth class SettingsViewController: UIViewController { @@ -106,7 +107,7 @@ extension SettingsViewController: UITableViewDelegate { //put in password changing code later print("password accepted please enter new password") - let alert2 = UIAlertController(title: "Change Password", message: "WARNING! You are about to change your vendoo account password. Please enter your current password to continue.", preferredStyle: .Alert) + let alert2 = UIAlertController(title: "Change Password", message: "WARNING! You are about to change your vendoo account password. Please enter your new password to continue.", preferredStyle: .Alert) alert2.addTextFieldWithConfigurationHandler({ (textField : UITextField!) -> Void in @@ -116,8 +117,25 @@ extension SettingsViewController: UITableViewDelegate { alert2.addAction(UIAlertAction(title: "Change Password", style: .Default, handler:{(action: UIAlertAction!) in let textField2 = alert2.textFields![0] as UITextField + + FIRAuth.auth()?.currentUser?.updatePassword(textField2.text!, completion: { + (error) -> Void in - print("your new password is \(textField2.text!). This will be take out once password change logic is implemented.") + if (error != nil) { + print(error) + }else { + print("Current user's new password is now \(textField2.text!).") + do{ + try Locksmith.updateData(["pass": textField2.text!], forUserAccount: (NSUserDefaults.standardUserDefaults().objectForKey("email") as? String)!, inService: "vendoo") + print("account credentials saved") + } + catch{ + //could not save data to keychain + print("account credentials could not be saved") + + } + } + }) })) alert.dismissViewControllerAnimated(false, completion: {})