Q:

How to reset a password using parse api?

I am using parse api as a service provider and data center so all my user information is stored in parse server and now i want to add a feature to my ios app for reseting a password but don't know how can i reset a password using parse api.
Can anyone help to know how can i use parse api to reset password of a user ?

A:

        PFUser.requestPasswordResetForEmailInBackground(emailTextField.text, block: { (succeeded: Bool, error: NSError?) -> Void in
            if error == nil {
                if succeeded { // SUCCESSFULLY SENT TO EMAIL
                           println("Reset email sent to your inbox");
                }
                else { // SOME PROBLEM OCCURED
                }
            }
            else { //ERROR OCCURED, DISPLAY ERROR MESSAGE
                 println(error!.description);
            }
        });

