Guest User

Untitled

a guest
Mar 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. class UserInformationHandler {
  2.  
  3. // MARK: - Public api
  4. func retrieve() {
  5. let data = request()
  6. let user = parse(data: data)
  7. store(user: user)
  8. }
  9. }
  10.  
  11. private extension UserInformationHandler {
  12. func request() -> Data {
  13. // Interaction with the api
  14. // Synchronous call for simplicity
  15. }
  16.  
  17. func parse(data: Data) -> [String: Any] {
  18. // parse data an create a dictionary
  19. }
  20.  
  21. func store(user: [String: Any]) {
  22. // Store on your local database, the information of the user
  23. }
  24. }
Add Comment
Please, Sign In to add comment