Skip to content

Commit 8c07087

Browse files
jaysonngJayson Ng
andauthored
Updated logout example (#755)
* Updated Swift usage Updated Swift usage based on parse-community/Parse-SDK-iOS-OSX#1311 * Update cloud-code.md * Added Example on how to abort Hooks and functions Added Example on how to abort Hooks and functions Source: https://github.com/parse-community/parse-server/blob/master/3.0.0.md * Revert "Added Example on how to abort Hooks and functions" This reverts commit 3350d09. * Added Example on how to abort Hooks and functions Added Example on how to abort Hooks and functions Source: https://github.com/parse-community/parse-server/blob/master/3.0.0.md * Revert "Added Example on how to abort Hooks and functions" This reverts commit 3350d09. * Update Swift login snippet to work with current version of Swift Update to change 1. NSError to Error when logging in 2. use updated function name * Updated currentUser() to current() Updated currentUser() to current() when checking for currentuser * Update login / logout Update to swift and ObjC login section to change currentUser() to current() * Revert "Update login / logout" This reverts commit 3299b67. * updated for latest version of Parse. updated for latest version of Parse. Co-authored-by: Jayson Ng <[email protected]>
1 parent 4b67fab commit 8c07087

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

_includes/ios/handling-errors.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ func callbackForGet(result: PFObject?, error: NSError?) -> Void {
5858
print("Everything went fine!")
5959
} else {
6060
if let error = error {
61-
if error.code == PFErrorCode.ErrorObjectNotFound.rawValue {
61+
if error._code == PFErrorCode.errorObjectNotFound.rawValue {
6262
print("Uh oh, we couldn't find the object!")
6363
} else {
64-
let errorString = error.userInfo!["error"] as? NSString
64+
let errorString = error._userInfo!["error"] as? NSString
6565
print("Error: \(errorString)")
6666
}
6767
}
@@ -95,13 +95,13 @@ func callbackForGet(result: PFObject?, error: NSError?) -> Void {
9595
print("Everything went fine!")
9696
} else {
9797
if let error = error {
98-
if error.code == PFErrorCode.ErrorObjectNotFound.rawValue {
98+
if error._code == PFErrorCode.errorObjectNotFound.rawValue {
9999
print("Uh oh, we couldn't find the object!")
100100
// Now also check for connection errors:
101-
} else if error.code == PFErrorCode.ErrorConnectionFailed.rawValue {
101+
} else if error._code == PFErrorCode.errorConnectionFailed.rawValue {
102102
print("Uh oh, we couldn't even connect to the Parse Cloud!")
103103
} else {
104-
let errorString = error.userInfo!["error"] as? NSString
104+
let errorString = error._userInfo!["error"] as? NSString
105105
print("Error: \(errorString)")
106106
}
107107
}

_includes/ios/users.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ PFUser *currentUser = [PFUser currentUser]; // this will now be nil
143143
```
144144
```swift
145145
PFUser.logOut()
146-
var currentUser = PFUser.currentUser() // this will now be nil
146+
var currentUser = PFUser.current() // this will now be nil
147147
```
148148
</div>
149149

0 commit comments

Comments
 (0)