I recently made a single-screen web-based application using PHP and AJAX. I want to port this app to iOS, and have started to teach myself Swift. I had the application working perfectly in Swift 1, but since I updated to xCode 7.2 and Swift 2 so that I could try the app on my iPhone with iOS 9, the code was completely non-functional. From here, I have new code now, and as far as I can see, it should work, but I am getting an empty response. What is wrong?
import UIKit
import Foundation
class LoginViewController: UIViewController, UITextFieldDelegate {
@IBOutlet weak var username_textField: UITextField!
@IBOutlet weak var password_TextFieldOutlet: UITextField!
@IBAction func password_TextFieldAction(sender: AnyObject) {
let username = username_textField.text
let password = password_TextFieldOutlet.text
var urlRequest = "~~URL~~/login.php?username=\(username)&password=\(password)"
}
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
The idea is I was to get my data from the database and see if "success" (a boolean value in the db) returns 1 or 0. If it returns 1, then perform a segue to next page, if not, create an alert saying incorrect username and password.
Thank you in advance!