How to sort NSOrderedSet by date in Swift
<p>I'm trying to sort a NSOrderedSet of an entity called Log which has 3 attributes (logDate, logDescription, logThumbnail) by date using NSSortDescriptor but it doesn't work.</p>

<pre><code>if let logs = projectSelected?.logs {
        let sd = NSSortDescriptor(key: "logDate", ascending: false)
        logs.sortedArrayUsingDescriptors([sd])
}
</code></pre>

<p>I have also tried to use projectLogs?.sortInPlace{$0.logDate!.compare($1.logDate!) == .OrderedAscending} to no success. What is the best solution for what I'm trying to do? Thank you in advance for your help.</p>