I am very new to Swift. I am creating a register page and applying validation to it. I want to validate the email and password. I am using outlet collection and I also want to know how to get a value from outlet collection. Here is the code. 

```
if senderTag == 0           // Name
    {

    }

    else if senderTag == 1      // Email
    {

        func validateEmail(candidate: String) -> Bool {

            let emailRegex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}"

            return NSPredicate(format: "SELF MATCHES %@", emailRegex).evaluate(with: candidate)

        }

        if validateEmail(candidate:How to use this?)

    }

    else if senderTag == 2
    {

        func isPasswordValid(_ password : String) -> Bool{

            let passwordTest = NSPredicate(format: "SELF MATCHES %@", "^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8}$")

            return passwordTest.evaluate(with: password)
        }

    }

    else if senderTag == 3
    {

        func isPasswordValid(_ password : String) -> Bool{

            let passwordTest = NSPredicate(format: "SELF MATCHES %@", "^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8}$")

            return passwordTest.evaluate(with: password)
        }
    }

```

I want to know what is wrong in here in email validation and how can I use password validation?

Thanks in advance