Guest User

Untitled

a guest
Oct 6th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. struct UserProfile {}
  2. func getProfile(token: String) -> Promise<UserProfile>
  3. func login(username: String, password: String) -> Promise<String>
  4.  
  5. login(username: "alfianlosari", password: "123456")
  6. .then { getProfile(token: $0 ) }
  7. .then { print("Profile Retrieved: \($0)") }
  8. .catch { print("Error: \($0)")
  9. }
Add Comment
Please, Sign In to add comment