9 replies
  1. Dan Pastori
    Dan Pastori says:

    Awesome tutorial! Thanks so much! The only thing that xCode gave an error for was in the LoginService, line 94 should be before line 92 due to some double checked instantiation ( I wish I knew more, but I’m just starting swift development ). I just moved those around and it worked great. Just out of curiosity, is it relatively safe to store the token in NSUserDefaults compared to the keychain? I have seen both, just wondering your opinion.

    • developerdave
      developerdave says:

      I would definitely store the token in the keychain rather than NSUserDefaults. Something I am working on actively at the moment so might share the User Management class I am currently working on in a future post.

  2. Sam
    Sam says:

    This is awesome! I’m a little confused by the last part:

    “In the Main.storyboard you need to hook up the signOut function. Click on the SignOut View Scene Ctrl drag from Sign Out to View Controller and select the signOut function.”

    Do you mean in the “Welcome View Controller Scene” since there is no SignOut view?

  3. Kate
    Kate says:

    Thank you for this tutorial. It’s been very helpful in getting me started. My xcode threw an error in the LoginService.swift file (line 193) related to an “extra argument (error) in call:
    var json = NSJSONSerialization.JSONObjectWithData(data, options: .MutableLeaves, error: &err) as? NSDictionary

    I’m new to swift development, so I’m having issues debugging. Based on the xcode documentation,

    • Kate
      Kate says:

      Ooops…it sent before I finished. #commentfail

      Based on the xcode documentation, I’m wondering if this error argument is needed. If so, how I can I fix the error? If not, is there a better way to structure things?

      Any help you can offer in debugging would be much appreciated. Thanks!

      Here’s the complete error: “extra argument ‘error’ in call”

  4. Maria
    Maria says:

    Thank you very much for your tutorial!
    I have been researching different approaches to implement login functionality in my swift app. I understand and appreciate your approach however, I found this other tutorial that seems to take care of this same type of scenario in a much simpler way in terms of which view should be presented whether the user is logged in or not. While you use a token this other tutorial uses a protected view which seems to simplify things.
    Could you please defend your approach versus the approach in this other tutorial in terms of security? One advantage I do see is clearly using a Singleton class in your approach. But the simplicity of the other tutorial cannot be ignored. I would just like to know if it’s still as a secure as your approach or not and why.
    At time: 16:20


Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *