Skip to content

Commit 4d556ec

Browse files
jaysonngJayson Ng
andauthored
Update Swift snippet in iOS guide for user doc (#741)
* Updated Swift usage Updated Swift usage based on parse-community/Parse-SDK-iOS-OSX#1311 * 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 Co-authored-by: Jayson Ng <[email protected]>
1 parent d980c5a commit 4d556ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

_includes/ios/users.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ Of course, after you allow users to sign up, you need to let them log in to thei
8787
}];
8888
```
8989
```swift
90-
PFUser.logInWithUsernameInBackground("myname", password:"mypass") {
91-
(user: PFUser?, error: NSError?) -> Void in
90+
PFUser.logInWithUsername(inBackground:"myname", password:"mypass") {
91+
(user: PFUser?, error: Error?) -> Void in
9292
if user != nil {
9393
// Do stuff after successful login.
9494
} else {
@@ -125,7 +125,7 @@ if (currentUser) {
125125
}
126126
```
127127
```swift
128-
var currentUser = PFUser.currentUser()
128+
var currentUser = PFUser.current()
129129
if currentUser != nil {
130130
// Do stuff with the user
131131
} else {

0 commit comments

Comments
 (0)