Skip to content

updated logout example #755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Aug 11, 2020
Merged
10 changes: 5 additions & 5 deletions _includes/ios/handling-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ func callbackForGet(result: PFObject?, error: NSError?) -> Void {
print("Everything went fine!")
} else {
if let error = error {
if error.code == PFErrorCode.ErrorObjectNotFound.rawValue {
if error._code == PFErrorCode.errorObjectNotFound.rawValue {
print("Uh oh, we couldn't find the object!")
} else {
let errorString = error.userInfo!["error"] as? NSString
let errorString = error._userInfo!["error"] as? NSString
print("Error: \(errorString)")
}
}
Expand Down Expand Up @@ -95,13 +95,13 @@ func callbackForGet(result: PFObject?, error: NSError?) -> Void {
print("Everything went fine!")
} else {
if let error = error {
if error.code == PFErrorCode.ErrorObjectNotFound.rawValue {
if error._code == PFErrorCode.errorObjectNotFound.rawValue {
print("Uh oh, we couldn't find the object!")
// Now also check for connection errors:
} else if error.code == PFErrorCode.ErrorConnectionFailed.rawValue {
} else if error._code == PFErrorCode.errorConnectionFailed.rawValue {
print("Uh oh, we couldn't even connect to the Parse Cloud!")
} else {
let errorString = error.userInfo!["error"] as? NSString
let errorString = error._userInfo!["error"] as? NSString
print("Error: \(errorString)")
}
}
Expand Down
2 changes: 1 addition & 1 deletion _includes/ios/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ PFUser *currentUser = [PFUser currentUser]; // this will now be nil
```
```swift
PFUser.logOut()
var currentUser = PFUser.currentUser() // this will now be nil
var currentUser = PFUser.current() // this will now be nil
```
</div>

Expand Down