title: Can i have 2 types on parameter in swift?
body: <p>so i've created function and it does something, but i want it to do something else if the parameter type is different, for example:</p>
  
  <pre><code>func (parameter: unknownType){
      if(typeof parameter == Int){
          //do this
      }else if(typeof parameter == String){
          //do that
      }
  }
  </code></pre>
  
  <p>i've done this in javascript or other programming languages, but i don't know how to do this in swift</p>
  
  <p>i've created function which takes 1 argument UITextField and centers it using constraints</p>
  
  <p>now i want to center my button, but since button is not UITextField type it does not work, so is there a way i can tell function to do the same on UIButton??</p>