iOS Functions in Swift Functions in Swift Basic Function Syntax

i wrote one project for username and password service call but i can't write username and password in login page

this is one of the login project it contains two view controller, viewcontroller and secondviewcontroller. i can't write username and password at the moment of login

functions.swift
// Enter your code belo//
//  ViewController.swift
//  Dashboard1
//
//  Created by Mac book Pro on 28/02/18.
//  Copyright © 2018 sinnonteq. All rights reserved.
//

import UIKit
class ViewController: UIViewController {

    @IBOutlet weak var imageView: UIImageView!

    @IBOutlet weak var memberLogin: UILabel!

    @IBOutlet weak var textField: UITextField!

    @IBOutlet weak var passwordField: UITextField!

    @IBOutlet weak var loginButton: UIButton!

        override func prepare(for segue: UIStoryboardSegue, sender: Any?)
    {
        var secondController = segue.destination as! SecondViewController
        secondController.myString = textField.text!
    }

    override func viewDidLoad()
    {
        let preferences = UserDefaults.standard

        if(preferences.object(forKey: "session") != nil)
        {
            LoginDone()
        }
        else
        {
            LoginToDo()
        }

    }
    @IBAction func loginButton(_ sender: Any)
    {
        if textField.text != ""

        {
            performSegue(withIdentifier: "segue", sender: self)

        if(loginButton.titleLabel?.text == "Logout")
        {
            let preferences = UserDefaults.standard
            preferences.removeObject(forKey: "session")

            LoginToDo()
            return
        }


        let username = textField.text
        let password = passwordField.text

        if(username == "" || password == "")
        {
            return
        }

        DoLogin(username!, password!)


        }

    }


    func DoLogin(_ user:String, _ psw:String)
    {
        let url = URL(string: "https://cpanel.q-hawk.com/adminPanel/login.php")
        let session = URLSession.shared

        let request = NSMutableURLRequest(url: url!)
        request.httpMethod = "POST"

        let paramToSend = "username=" + user + "&password=" + psw

        request.httpBody = paramToSend.data(using: String.Encoding.utf8)


        let task = session.dataTask(with: request as URLRequest, completionHandler: {
            (data, response, error) in

            guard let _:Data = data else
            {
                return
            }

            let json:Any?

            do
            {
                json = try JSONSerialization.jsonObject(with: data!, options: [])
            }
            catch
            {
                return
            }


            guard let server_response = json as? NSDictionary else
            {
                return
            }


            if let data_block = server_response["data"] as? NSDictionary
            {
                if let session_data = data_block["session"] as? String
                {
                    let preferences = UserDefaults.standard
                    preferences.set(session_data, forKey: "session")

                    DispatchQueue.main.async (
                        execute:self.LoginDone
                    )
                }
            }

        })

        task.resume()
    }


    func LoginToDo()
    {
        textField.isEnabled = true
        passwordField.isEnabled = true

        loginButton.setTitle("Login", for: .normal)
    }

    func LoginDone()
    {
        textField.isEnabled = false
        passwordField.isEnabled = false

        loginButton.setTitle("Logout", for: .normal)
    }



    override func didReceiveMemoryWarning()
    {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
    {
        self.view.endEditing(true)
    }
    func textFieldShouldReturn(_ textField: UITextField) -> Bool
    {
        textField.resignFirstResponder()
        return(true)
    }
}

w