title: Swift: sort array with alternative comparison
body: <p>I'd like to sort my swift struct array using another comparison method (like localizedCompare, caseInsensitiveCompare or localizedCaseInsensitiveCompare).  The swift standard string array sort function orders all uppercase letters before lowercase letters.  Here's my code:</p>
  
  <pre><code>import Foundation
  
  struct DataStruct {
  
      struct Item {
          let title: String
          let number: Int
      }
  
          static var items = [
          Item(title: "apple", number: 30),
          Item(title: "Berry", number: 9),
          Item(title: "apple", number: 18)]
  }
  
  class DataFunctions {
      func sortItemsArrayTitle() {
          DataStruct.items.sort { $0.title &lt; $1.title }
      }
  }
  </code></pre>
  
  <p>Once called, the above code results in [Berry, apple, apple].  Unacceptable. Any suggestions?</p>