Hello,
what means expected ',' seperator? I have tihs error in my last row (76)
i can chance my code but everytime that error is at the end of my code!!
mport UIKit
class RegisterPageViewController: UIViewController {
@IBOutlet weak var userEmailTextField: UITextField!
@IBOutlet weak var userPasswordTextField: UITextField!
@IBOutlet weak var userRepeatPasswordTextField: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
@IBAction func registerButtonTapped(sender: AnyObject) {
let userEmail = userEmailTextField.text;
let userPassword = userPasswordTextField.text;
let userRepeatPassword = userRepeatPasswordTextField.text;
}
func displayMyAlertMessage(userMessage:String) {
if((userEmail.isEmpty || userPassword.isEmpty || userRepeatPassword.isEmpty) {
displayMyAlertMessage("All fields are required")
return {
if(userPassword != userRepeatPassword) {
displayMyAlertMessage("Password do not match")
return }
let myUrl = NSURL(string: "www.2in1courier/twoinone_userLoin");
let request = NSMutableURLRequest(URL: myUrl!);
request.HTTPMethod = "POST";
let postString = "email=\(userEmail)&password=\(userPassword)";
request.HTTPBody = postString.dataUsingEncoding(NSUTF8StringEncoding);
let task = NSURLSession.sharedSession().dataTaskWithRequest(request) {
data, response, error in
if error != nil {
println("error=\(error)")
return
}
var err: NSError?
var json = NSJSONSerialization.JSONObjectWithData(data, options: .MutableContainers, error: &err) as? NSDictionary
if let parseJSON = json {
var resultValue = parseJSON["status"] as? String
println("result: \(resultValue)") }
var isUserRegistred:Bool = false;
if (resultValue=="Success") { isUserRegistred = true
}
var messageToDisplay:String = parseJSON["message"] as String!;
if(!isUserRegistred) {
messageToDisplay = parseJSON["message"] as String!;
}
dispatch_async(dispatch_get_main_queue()) {
var myAlert = UIAlertController(title: "Alert", message: messageToDisplay, preferredStyle: UIAlertControllerStyle.Alert)
let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default) {
action in
self.dismissViewControllerAnimated(true, completion: nil)
}
myAlert.addAction(okAction)
self.presentViewController(myAlert, animated: true, completion: nil)
}