I'm trying to convert the following line of code from Swift 2 to Swift 3 while upgrading my program but I can't figure out what the equivalent is for Swift 3?
guard let password = passwordField.text!.stringByAddingPercentEncodingWithAllowedCharacters(.URLHostAllowedCharacterSet()) , !password.isEmpty else {
displayErrorMessage(errorMessage: "Password can not be empty!")
return false
}
The error I get is:
****Value of type 'String' has no member 'stringByAddingPercentEncodingWithAllowedCharacters'****