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
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! 🙂