title: Sorting by keypath in Realm
body: <p>In my application, I have a Realm model called Trip which stores information about limousine trips. Each trip has a number of Location models associated with it. I'd like to sort my Trips by the <code>arriveAt</code> value on the first Location of a trip. Essentially I want:</p>
  
  <pre><code>let realm = Realm()
  let trips = realm.objects(Trip).filter("closed = false").sorted("locations[0].arriveAt")
  // Results with Terminating app due to uncaught exception 'Invalid sort property', reason: 'Cannot sort on 'locations[0].arriveAt': sorting on key paths is not supported.'
  </code></pre>
  
  <p>Is this possible with Realm without converting my result object to an array?</p>
  
  <hr>
  
  <p><strong>Edit:</strong></p>
  
  <p>I also am looking to group my results by the date from <code>locations[0].arriveAt</code>, so in a Table view the sections are each day and trips underneath each header by the time.</p>