Swift, PHP & MySQL. User Sign Up, Sign In, Sign out and more

Learn how to create User Sign Up, Sign In, Sign out, Password reset, Email verification and more with Swift, PHP & MySQL
4.6 (139 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
724 students enrolled
$35
Take This Course
  • Lectures 92
  • Contents Video: 13 hours
    Other: 1 min
  • Skill Level Beginner Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 7/2015 English

Course Description

Almost every mobile application requires User Sign up, Login, Logout and Password reset functionality. Also, very often mobile apps use left side menu as navigation which is some times called Navigation Drawer.

In this course we will create a fully functional examples that you can take and integrate into your Swift mobile app.

We will use Xcode development environment and Swift programming language to create:

  • User interface for User Sign Up view,
  • User interface for User Sign in view,
  • User interface for Sign Out functionality
  • User interface for Password Reset functionality
  • Email Verification feature
  • Left side navigation menu or navigation drawer with 3 different views. Left side panel for navigation menu, centre view and right side panel for additional information if needed. This Navigation drawer will serve as a main container of your mobile app which needs to be protected with user login view.
  • Using phpMyAdmin we will create a new MySQL database
  • We will learn to create new MySQL database tables
  • We will learn how to establish MySQL database connection from our PHP script
  • We will learn to write "select", "insert", "update" and "delete" SQL queries
  • We will write business logic to upload user profile picture to our server
  • We will write business logic to implement User Sign up, Sign in and Sign out functionality
  • We will write business logic to implement Password Reset functionality and Email verification feature
  • Send Push Messages using PHP scripts.

    Bonus:
  • We will create Application left side sliding menu which is sometimes called Navigation Drawer which will be displayed after user successfully logs into our application.
  • Left side menu or Navigation Drawer will have left side panel as well as right side panel which user will be able to "Tap to open" or "Swipe to open"
  • We will integrate into our application a very popular and customizable activity indicator called MBProgressHUD


You will also learn How To Create Your Own Push Notifications Server. We will learn how to use easy apns open source project to send different types of push messages to a specific iOS device registered with our application and how to send a new push message to multiple iOS devices at the same time.

What are the requirements?

  • Xcode 6
  • Basics of Swift
  • Basics of PHP
  • Install XAMPP (Apache 2 web server, PHP & MySQL database server)

What am I going to get from this course?

  • Create user interface for the Sign up, Sign in, Sign out & password reset functionality
  • Learn to send HTTP POST requests to submit information to server side PHP script
  • Learn to select a picture on mobile device and upload it to a server side
  • Display custom Activity Indicator
  • Integrate Objective C projects into Swift App
  • Create Navigation Drawer with Left side and Right side panels
  • Write PHP scripts to handle HTTP GET & Post requests
  • Write PHP scripts to establish connection with MySQL database
  • Create new MySQL database and create new database tables
  • Send email message with PHP script

What is the target audience?

  • Novice Mobile App developers for iOS Platform

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Introduction
Introduction
Preview
01:03
Source code for Sections 1-10
Article
Section 2: Creating user interface in Xcode with Swift
09:08

In this video we are going to create user interface for the Sign in page. The page will have two text fields and a button.

Each text field will have a clear text button.

Password text field will be a secure text entry field which will automatically replace password characters with solid black circles.

07:59
In this video we are going to create user interface for the Sign Up page. We are going to work on:
  • Create a few UITextFields
  • Make password text fields a secure text entry fields
  • Add clear button to each UITextField
  • Activate keyboard Next button or Done button
  • For each UITextField create a Delegate connector
04:24

Protected page is the one which user will see only after they successfully sign in. Our protected page will display some of the user details and will have a Sign Out button.

03:18

In this video we are going to enable the Cancel button, so that user can dismiss Sign Up View Controller and go back to Sign in page.

Section 3: Working with MySQL Database
08:34

In this video we are going to use phpMyAdmin to create a new MySQL Database for our project and we will learn how to create a new database table "users"

Section 4: Writing server side scripts in PHP
06:11

In this video I am going to share with you my server side infrastructure which is very common.

  • Web server: Apache 2
  • Server side programming language: PHP
  • Database server: MySQL server
To install Apache, PHP and MySQL I used XAMPP which you can download from https://www.apachefriends.org
03:58

In this video we are going to create MySQL data access object which will be used to establish database connection with our MySQL server and will contain all functions which communicate with MySQL Database.

22:31

In this video we are going to create PHP script to register a new user.

Secure way to store MySQL database access details
07:55
10:34

In this video we are going to create a new PHP script which will perform user sign in.

06:53

In this video we are going to create a new PHP script which will accept image sent to it via HTTP POST request from mobile application and will store it inside of our web folder /profile-pictures/<user-id>/user-profile.jpg

Section 5: Communicating with Server Side PHP Scripts
08:25

In this video we are going to collect information from each text field and make sure all fields are filled in.

16:05

In this video we are going to send user Sign Up details to our server side script as HTTP POST request.

22:46

In this video we will send user Sign in details to server side script to perform Sign in.

07:33

In this video we are going to read JSON string returned from server side and display user first name and user last name on the main page

05:57

In this video we are going to implement User Sign out feature. We will clear user details stored on the device and redirect user back to Sign in page.

05:20

In this video we are going to remember user sign in state so that when application is restarted user does not need to sign in again if they were previously signed in.

Section 6: Uploading user profile picture
08:20

In this video we are going to implement UIImagePickerController and let user select an image from their photo library

18:48

In this video we are going to upload user profile picture.

04:18

Directory permissions.

10:27

Make user profile picture display on the main page when it is about to appear.

Section 7: Adding Activity Indicator - MBProgressHUD
10:34

Adding Activity Indicator to pages that communicate with server

Section 8: Implementing Navigation Drawer
03:43

In this video we are going to download and integrate into our Swift app an open source project to Implement Navigation Drawer.
You can download MMDrawer from github by following this link: https://github.com/mutualmobile/MMDrawerController

03:36

In this video we will create a new view controller which will hold TableView and UIImage. This new left side view controller will be our navigation panel.

02:13

In this video we will create a new ViewController which will be our right side panel.

12:03

In this video we are going to put all there panels(Left side, Right side and Center view) together into a single Navigation Drawer.

08:54

In this video we are going to add three menu options to our left side table view.

09:08

In this video we are going to implement UITableVideDelegate protocol and make our left side menu tappable.

Add Left side and Right side Bar Item Buttons
09:11
Section 9: Email Verification Feature
04:43

In this video we are going to begin working on Email verification feature.

07:39

In this video we are going to begin working on EmailConfirmation PHP class which will contain functions needed to implement the feature.

05:26

In this video we are going to store user email token into a new database table.

14:19

In this video we are going to prepare email message which needs to be sent to a user and will send this message using PHP mail() function.

12:23

In this video we are going to create a new PHP script called ConfirmEmailAddress.php

Section 10: Implementing Password Reset Feature
05:34

In this video we are going to implement one more user interface for the Forgot Password page.

19:47

In this video we are going to implement new custom Swift class responsible for the Forgot Password user interface.

11:41

In this video we are going to create a new PHP script called RequestNewPassword.php

05:33

In this video we are going to create a new convenience class to organized functions related to Forgot Password feature.

04:57

In this video we are going to generate a new password token to be stored in database

02:09

In this video we are going to create a new database table to store password tokens.

09:12

In this video we are going to prepare an email template message and send an email message with a link to reset password to a user.

19:09

In this video we are going to create a new PHP page to let user create their new password.

04:40

In this video we are going to test the "Forgot password" feature and make sure everything works well.

Section 11: Source code
Article

Xcode project: 
Download ZIP archive: https://github.com/simplyi/swift-php-mysql/archive/master.zip
Github page: https://github.com/simplyi/swift-php-mysql


Article

Here is a link to download PHP source code of the project: https://github.com/simplyi/swift-php-mysql-netbeans-project

Section 12: Push Notification Server with MySQL & PHP
04:46

In this videos we are going to learn about an open source project which we are going to use in this section to create our own push notifications server. I will walk you through the project's web site and will give a general description of it's content.

Article

You can download source code of Xcode project used in this section (Push Notifications) from this github url: https://github.com/simplyi/pushNotificationsExample

13:45

In this video we are going to learn about the structure of easy apns project and look at the php scripts it contains. This is an introductory section and is very important to compete. We will configure php scripts later on in this section.

21:25

In this section we will create Apple Push Notification Certificates that we need to use to be able to send push messages from our php scripts.

04:53

In this video we are going to learn how to create iOS Development and Production Certificates that we need to use to develop our app. For the purpose of being able to share our app with testers from our web site or via services like TestFlight or HockeyApp we will later also create an adHoc provisioning profile which requires certificate we are creating in this section.

03:23

In this video we are going to add an iOS device to the list of devices on our Apple Developer Account. This device will be used to test our application and receive push notifications.

10:28

In this lecture we are going to learn how to create and install into Xcode iOS Provisioning Profiles for Debugging, Release and adHoc purposes.

- adHoc provisioning profile is used when we are ready to share our app with testers from our web site or services like TestFlight or HockeyApp.

- Release type provisioning profile will be used when submitting application to the app store

10:06

In this video we will import project's database tables into our new MySQL database.

01:55

In this video we will copy easy apns php scripts into our project and have them ready to be configured.

15:42

In this lecture we will configure php scripts, so that our project can send push messages. We will learn how to make our php scripts use the push notifications certificates we have created earlier and how set up database connection with our project's database.

24:00

In this lecture we will open Xcode and will configure our app's AppDelegate swift file, so that our app can register to receive push notifications.

04:16

In this video I will show you how to configure info.plist file, so that our app can communicate with remote servers even though we do not have SSL Certificate installed and our HTTP requests are not sent over HTTPs. This is not recommended to do but if you do not have SSL certificate this little configuration will help you move on. Other wise you might not need to do it.

03:17

In this video we will run our application and see if it can successfully register for push notifications. We will also check our MySQL database table to see if device information is successfully recorded.

11:51

In this lecture we will learn how to create our very first push message using easy apns project and also how to send a push message to a specific iOS device registered with our application.

05:18

In this video we will learn how to send push message to multiple iOS devices registered with our application.

12:47

In this lecture we will learn how to display received push message to the user while our application was up and running. We will display push message content right from the AppDelegate swift file using UIAlertController dialog window.

Section 13: iOS App Localization: Add an International Language Support.
10:00

In this video you will learn how to:

  • Add localization support to your iOS Swift App and it’s Main.storyboard,
  • How to quickly preview user interface in a different language while designing user interface and,
  • How to run application on iOS Simulator with support for different Application Language or Application Region,
  • We will also briefly cover how to export iOS App for Localization and how to import translated app file(.xliff) back into Xcode.
07:23

In this video you are going to learn how to localize app resources like images. Same approach can be used to localize local app resources like sound files or video files.

13:34
Learn how to localize iOS App text messages that are displayed to user. For example in this video we will localize UIAlertController Title and the main text displayed to a user. We will use NSLocalizedString to read localized text from Localizable.strings.
Section 14: Search Records in Database and Display in UITableView
02:19

In this section we will learn how to implement Search feature for our mobile application. We are going to learn:

  • How to create and test SQL queries using phpMyAdmin
  • How to implement PHP script that executes SELECT SQL query
  • Implement PHP Script to receive HTTP POST request from mobile app, perform search and return search result back to mobile app
  • Implement UITableView to display search results
  • Implement UISearchBar to let user type search word and send data to server side PHP script.
Article
You can download updated and working source code of Xcode project used in videos from this url https://github.com/simplyi/SearchFeatureExample
Article

You can download updated and working PHP scripts and entire Netbeans project from this url: https://github.com/simplyi/swift-php-mysql-netbeans-project

12:03

In this video we are going to learn how to create and test SQL SELECT query using phpMyAdmin.

07:57

In this lecture you are going to learn how to create a searchFriends function which will execute SQL Select query and return back to a calling script a list of rows from a database what matched search criteria.

11:22

In this lecture we are going to learn how to create the seachFriends php script, which will accept HTTP Post request parameters and will call searchFriends function which will perform SQL SELECT query and return the search result. We will also learn how to test searchFriends php script in the browser window and how to pass to it the searchWord request parameter via the browser url query string.

07:38

In this lecture we are going to use Xcode to design user interface of our Search feature. We are going to learn how to position UITableView in our UIViewController and how to add to it the UISearchBar.

09:56

In this video we are going to learn how to make our UITableView load data by making our UIViewController conform to a UITableViewDataSource and implementing the table view's numberOfRowsInSection function as well as the cellForRowAtIndexPath function.

05:34

In this video we are going to learn how to handle UISearchBar events like "User tapped on a keyboard Search button" by making our UIViewController conform to a UISearchBarDelegate and implementing the searchBarSearchButtonClicked function.

27:15

In this video we are going to learn how to send HTTP Post request using Swift and convert data received from PHP script from JSON document into NSDictionary. We will also learn how to handle error message and display message to user using UIAlertController in Swift.

05:32

In this lecture we are going to learn how to create Bar Button Item and position it on the top right side corner. This button will work as Cancel button to clear text of UISearchBar, clear data loaded to UITableView and reload UITableView data.

Section 15: Delete Records from Database
Source code
Article
05:46

A short introduction to this section.

03:37

In this video we will learn how to test simple delete query in phpMyAdmin

18:43

In this video we will prepare a delete friend record function which will perform SQL DELETE query

10:39

In this video we will write PHP code that will accept one request parameter and will call the delete friend function which will delete a record from database

14:21

In this video we will create UIBarButtonItem which will toggle UITableView state editing mode. We will implement UITableViewDelegate's function to remove table view cell. 

03:12

In this video we will learn how to disable the swipe to delete table cell feature when table view is not in an editable mode.

18:43

In this video we will write Swift code to send an HTTP post request to our server side php script which will delete a friend record from our database

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Sergey Kargopolov, Mobile Application Developer

I am a full-time mobile application developer, and building mobile apps is what I do every single day. I have been developing different types of Software since 1997 and used to be Sun Certified Java Programmer and Sun Certified Web Application Developer before Oracle bought out Sun.

I'm also a blogger at SwiftDeveloperBlog with passion for teaching people programming languages. While being a full-time developer, throughout my life I enjoyed teaching "Computer Science" course for high-school students at Kazakh-American High School, "Computer Science" course for 1st year students at Kazakh-American University and I also taught "Web Development with HTML and CSS" course for USAID employees. Now I use my passion for teaching to help beginner programmers to reach their goals in development of their first mobile applications through a step-by-step videos on my Blog, YouTube channel and by becoming an instructor on Udemy.

Happy coding and I see you in the course:)

Sergey

Ready to start learning?
Take This Course