In this video I am showing how to implement password recovery feature for Swift App that uses Parse for User login and Registration.
In this video I am implementing Password Recovery feature for the App I have created earlier. To see how I’ve implemented User Login and Registration UI, how to integrate Parse into your Swift app please watch Videos at the end of this blog post.
Below are the two main functions I used in my video:
recoverButtonTapped source cede
@IBAction func recoverButtonTapped(sender: AnyObject) {
let userEmail = userEmailTextField.textPFUser.requestPasswordResetForEmailInBackground(userEmail) {(success:Bool, error:NSError?) -> Void inif(success)
{
let successMessage = “Email message was sent to you at \(userEmail)”
self.displayMessage(successMessage)
return
}
if(error != nil)
{
let errorMessage:String = error!.userInfo![“error”] as! String
self.displayMessage(errorMessage)
}
}
}
displayMessage source cede
func displayMessage(theMesssage:String)
{
// Display alert message with confirmation.
var myAlert = UIAlertController(title:"Alert", message:theMesssage, preferredStyle: UIAlertControllerStyle.Alert);let okAction = UIAlertAction(title:"Ok", style:UIAlertActionStyle.Default){ action in
self.dismissViewControllerAnimated(true, completion:nil);
}
myAlert.addAction(okAction);
self.presentViewController(myAlert, animated:true, completion:nil);
}
– To learn how to integrate Parse into your Swift App, watch this video https://youtu.be/wrMoVUe_oVg
– To learn how to create UI for this example please watch this video: https://youtu.be/a5pzlbBnfYg?list=PLdW9lrB9HDw2o0UI8cNXXN64LE7oEYrZM
– To learn how to make this example work with MySQL and PHP, here is a page with video and source code https://www.swiftdeveloperblog.com/store-user-information-in-mysql-database/
Also I published my first course on Udemy “Swift programming: User sign up, sign in, password reset and more” on exactly this topic: user sign up, sign in, sign out, password reset, email activation, and Navigation drawer left side and right side sliding panels and even more.. If you are interested, please check it out and watch the promo video to learn about the content of the course: https://www.udemy.com/swift-developer-cookies-user-sign-up-login-password-reset/