title: iOS Swift max(), min()
body: <p>In Swift, I am trying to use the max() and min() functions.</p>
  
  <pre><code>max&lt;T : Comparable&gt;(x: T, y: T, rest: T...) -&gt; T
  min&lt;T : Comparable&gt;(x: T, y: T, rest: T...) -&gt; T
  </code></pre>
  
  <p>I am trying to use the max() function in this way:</p>
  
  <pre><code>var paddleX: Int = Int(paddle.position.x) + Int(location.x - previousLocation.x)
  max(paddleX, paddle.frame.x/2, nil)
  </code></pre>
  
  <p>but I am getting this error:</p>
  
  <blockquote>
    <p>Cannot convert the expression's type of '()' to type 'NilType'</p>
  </blockquote>
  
  <p>Is the <code>nil</code> causing this problem? What is <code>rest: T...</code> supposed to be?</p>