Skip to content

Swift Developer Blog

Learn Swift and App Development for iOS

  • Swift Blog
    • UITableView
    • UIImageView
    • UIScrollView
    • UIWebView
    • SubView
    • UIImagePickerController
    • UIPageViewController
    • UITabBarController
    • UIAlertController
    • UISegmentedControl
    • Xcode
    • Firebase
  • Video Tutorials
  • Code Examples
    • Code examples
    • Cheat Sheets
  • Resources
    • Swift Developer
  • Full stack
    • Developer Resources
    • Android & Kotlin
    • Java
    • RESTful Web Services
    • Amazon Web Services
    • Firebase with Kotlin
    • Firebase with Swift
    • Hibernate
    • Git
    • Design Patterns
  • About
  • Contact me
  • Home
  • Cocoa Touch and Swift tutorials
  • User Registration, Sign in And Token Based Authentication
August 30, 2017 by Sergey Kargopolov 0 comments on "User Registration, Sign in And Token Based Authentication"

User Registration, Sign in And Token Based Authentication

Earlier I have shared a series of video tutorials on how to create user Login and Registration pages for your mobile application that communicates with a server side php scripts running on Apache Web Server. In this blog posts I am going to share with you a series of video tutorials that demonstrate how to create User sign in, sign up and sign out features for your Swift mobile application. These video tutorials are step by step instructions and cover a lot of useful information which you can use not only in Login and Register features but in other features of your mobile app as well.

The video tutorial below are created with Xcode 9 beta and Swift 4 and cover the following:

  • Create new project using Xcode 9,
  • User Main.storyboard to create User Interface for pages: Sign up, Sign in and Protected page,
  • Learn how to create UITextFields that accept plain text as well as Email or User Password. To let user input their password we will use a Secure Text Field,
  • Learn how to create UIButtons and handle button events
  • Learn how to create UINavigationBar and add a Sign out or a Log out button on the top left side of the navigation bar,
  • Learn how to read information inputed into UITextFields and create a JSON Payload which will be send as an HTTP Request,
  • Check UITextFields for empty values and learn how to compare String values in Swift,
  • Lean how to create and sent HTTP GET as well as HTTP Post requests,
  • Add HTTP headers to HTTP Request. We are going to add HTTP header fields like: the Accept header field,  the Content-type header field and the Authorization header field,
  • You will learn how to perform Token Based User Authentication,
  • You will learn how to convert NSDictionary to JSON payload and then convert JSON Payload received from the server side back to NSDictionary,
  • The user id and the access token mobile app receives when user logs in successfully into the app will be stored in iOS Keychain. So you will learn how to store sensitive information like user id and access token in iOS Keychain. We will discuss how to store, how to read from Keychain and how to delete information from Keychain,
  • I am going going to show you how to use Cocoapods to install new libraries to your iOS Project,
  • We are going to use Cocoapods to install SwiftKeyChainWrapper which is going to greatly simplify the way we work with iOS Keychain
  • I am also going to show you how to display a spinning UIActivityIndicator that lets user know they need to wait a few seconds while HTTP Request is being performed,
  • And I am going to show you how to display dialog messages using UIAlertController in Swift.

As you can see this blog post and this series of video tutorials contain lots of useful information and all of it in a form of video step by step instructions.

You can download the source code of my Xcode project used in this video tutorials here: https://github.com/simplyi/user-registration

Also, the below video tutorials send http request to a RESTful Web Service endpoints which have been developed in Java. Below are the links to my blog posts with explanation and source code which should help you implement similar RESTful Web Services for your mobile app.

Create RESTful Web Service For Your Mobile App

Below is a list of free video tutorials which should help you implement User Registration and User Login features for your mobile application with Swift and Xcode:

  • Create Jersey JAX-RS Project with Maven
  • RESTful Web Service to Save a New User in Database
  • RESTful Web Service to Authenticate User and Issue Access Token
  • Token-based Authentication Example
  • Exception Handling in a RESTful Web Service

User Sign up, Sign in, Sign out and Token Based Authentication Video Tutorials In Swift

subscribeSubscribe to receive more videos
«
Prev
1
/
1
Next
»
loading
play
User Sign in, Sign up and Sign out in Swift - 1. Introduction
play
User Sign in, Sign up and Sign out in Swift - 2. Creating Sign in User Interface
play
User Sign in, Sign up and Sign out in Swift - 3. Sign Up Page User Interface
play
User Sign in, Sign up and Sign out in Swift - 4. Protected Page User Interface
play
User Sign in, Sign up and Sign out in Swift - 5. Sign in Page Outlets
play
User Sign in, Sign up and Sign out in Swift - 6. Sign Up Page Outlets
play
User Sign in, Sign up and Sign out in Swift - 7. Dismiss Sign Up Page
play
User Sign in, Sign up and Sign out in Swift - 8. Protected Page Connection Outlets
play
User Sign in, Sign up and Sign out in Swift - 9. Presenting Sign up page
play
User Sign in, Sign up and Sign out in Swift - 10. Sign up Page Swift Code
play
User Sign in, Sign up and Sign out in Swift - 11. Sign In Page Swift Code
play
User Sign in, Sign up and Sign out in Swift - 12. Save Access Token in Keychain
play
User Sign in, Sign up and Sign out in Swift - 13. Skipping Sign In Page
play
User Sign in, Sign up and Sign out in Swift - 14. Sign out & Clean Keychain
play
User Sign in, Sign up and Sign out in Swift - 15. User Access Token to Load User Profile
«
Prev
1
/
1
Next
»
loading

I hope these video tutorials are helpful to you! If you have questions, please comment below and hopefully myself or someone else who has followed these steps will help you out.

Also, check out this page where I have collected some very useful video lessons, books and courses which will help you to become a Full Stack Mobile App Developer faster.

Happy learning! 🙂

[raw_html_snippet id=”cookbookpagecoursesheader”]



Posted in: Cocoa Touch and Swift tutorials, Swift & Java
Tagged: Access Token, Authentication, Java, Keychain, Keychainwrapper, log out, Register, REST, RESTful, Sign in, Sign out, Sign up, Swift

Post navigation

Previous Previous post: RESTful Web Services with Java for your Swift Mobile Application
Next Next post: UIAlertController – Confirmation Dialog in Swift

Primary Sidebar

Find videos

Unit Testing Swift?

Unit Testing Swift Mobile App

Recent Posts

  • Inject JavaScript into WKWebView
  • WKWebView. Load HTML File from App Bundle.
  • UIImagePickerController in Swift with Firebase. Cheat Sheet.
  • Firebase Realtime Database Cheat Sheet
  • Push Notifications with Firebase Cloud Messaging – Cheat Sheet

Search by Tag

AWS Facebook Facebook SDK Facebook Sign in Firebase HTTP HTTP Get HTTP Post Icon Java Keychain Load Images Login MMDrawerController MySQL Navigation Drawer NSURLSession Parse Password PHP Push Notifications Search Sign in SubView Swift UIActivityIndicator UIAlertController UIImage UIImagePickerController UIImageView UIPageViewController UIScrollView UISearchBar UISegmentedControl UITabBarController UITableView UITableViewCell UITableViewController UITableViewDatasource UIWebView Upload Xcode Xcode Tips Xcode Tips and Tricks XIB

Featured posts

  • Left side menu (Navigation Drawer) example with Swift
  • Creating custom user interface files with XIB in Xcode 6 and Swift
  • Add Subview and Remove subview example in Swift
  • Customize UINavigationBar appearance in Swift
  • MBProgressHUD example in Swift
  • iOS Keychain example in Swift
  • Image Upload with Progress Bar example in Swift
  • Circular Image or Image with Rounded Corners. Example in Swift

Copyright © 2023 Swift Developer Blog. Powered by WordPress and Themelia.

Would you like more video tutorials weekly?
  • Swift programming with Parse. Practical Examples.
  • Swift programming with PHP and MySQL. Practical examples.
  • iOS Mobile Apps Development with Swift

Enter your email and stay on top of things,

Subscribe!