Use of LoginKit for Login/Signup UX to build a mysql-php user registration example.
Branch: master
Clone or download
Latest commit f3af1ed Aug 14, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
AuthSample.xcodeproj updated Jun 6, 2018
AuthSample.xcworkspace fixed screenshots Aug 14, 2018
AuthSample final Jun 6, 2018
Pods updated Jun 6, 2018
phpscripts updates May 22, 2018
screenshots fixed screenshots Aug 14, 2018
.DS_Store fixed screenshots Aug 14, 2018
Podfile updated Jun 6, 2018
Podfile.lock updated Jun 6, 2018
README.md updated readme Aug 14, 2018
gitignore updates May 22, 2018

README.md

iOS: user management in Swift

This repo is associated to an iOS tutorial I am currently sharing. It helps you implement user management in Swift with Alamofire and PHP/MySQL and includes a Facebook registration module.

Description

This repo and the associated tutorial demos the following:

LoginKit takes care of the UI, the forms, the data validation, and Facebook SDK access. All we need to add is the necessary calls to our own backend API to login or signup.

  • Use of Alamofire to consume PHP/MYSQL backend for user registration

A very simple php backend for signup/login to a MySQL database is consumed through the Alamofire HTTP networking library:

override func signup(name: String, email: String, password: String){

        let parameters: Parameters=[
           "email":email,
           "password":password,
           "username":name]
        
        Alamofire.request("http://102.157.226.95:8888/authSample/register.php", method: .get, parameters: parameters).responseJSON
            {
                response  in
                if let result = response.result.value
                {
                    let jsonData = result as! NSDictionary
                    let val = jsonData.value(forKey: "value") as! Int64
                    print("VALUE:\(val)")
                    
                    if(val==0){
                        print("fail")
                        self.didSelectSignup(self.viewController, email:email, name:name, password:password)
                    }
                    else if(val==1){
                        print("succes")
                        let alert = UIAlertController(title: "Registered !", message: "You havee been successfully registered!", preferredStyle: UIAlertControllerStyle.alert)
                       
                        alert.addAction(UIAlertAction(title: "Take me to login", style: UIAlertActionStyle.cancel) {
                            UIAlertAction in
                           // super.didSelectLogin(self.visibleViewController()!, email: "", password: "")
                           self.signupDidSelectBack(self.viewController)
                        })
                        self.visibleViewController()!.present(alert, animated: true, completion: nil)
                    }
                }
        }
    }

  • Facebook SDK for Swift integration

Easy and clear implementation of Facebook SDK for Swift.

Getting started

Clone this repository and import into Xcode

git clone https://github.com/AmalH/User-registration-with-alamofire_mysql-and-facebook_sdk.git