title: How to use addTarget method in swift 3
body: <p>here is my <code>button</code> object </p>
  
  <pre><code>    let loginRegisterButton:UIButton = {
      let button = UIButton(type: .system)
      button.backgroundColor = UIColor(r: 50 , g: 80, b: 130)
      button.setTitle("Register", for: .normal)
      button.translatesAutoresizingMaskIntoConstraints = false
      button.setTitleColor(.white, for: .normal)
      button.addTarget(self, action:#selector(handleRegister), for: .touchUpInside)
      return button
  }()
  </code></pre>
  
  <p>and here is my function </p>
  
  <pre><code>    func handleRegister(){
  
      FIRAuth.auth()?.createUser(withEmail: email, password: password,completion: { (user, error) in
  
          if error != nil
          { print("Error Occured")}
  
          else
          {print("Successfully Authenticated")}
      })        
  }
  </code></pre>
  
  <p>I'm getting compile error, if addTarget removed it compiles successfully </p>