Swift - Sort array of objects with multiple criteria
<p>I have an array of <code>Contact</code> objects: </p>

<pre><code>var contacts:[Contact] = [Contact]()
</code></pre>

<p>Contact class:</p>

<pre><code>Class Contact:NSOBject {
    var firstName:String!
    var lastName:String!
}
</code></pre>

<p>And I would like to sort that array by <code>lastName</code> and then by <code>firstName</code> in case some contacts got the same <code>lastName</code>.</p>

<p>I'm able to sort by one of those criteria, but not both.</p>

<pre><code>contacts.sortInPlace({$0.lastName &lt; $1.lastName})
</code></pre>

<p>How could I add more criteria to sort this array?</p>