title: Powering Master-Detail with CloudKit
body: <p>I have a <code>UISearchResultsController</code> that searches locally while typing, and remotely (CloudKit) when the search button is pressed. The number of results returned needs to be 10-30 (I'm currently testing my app with 25 and it's always enough)</p>
  
  <p>The search results list is populated with <code>RecordType1</code>, while it's detail is populated by <code>RecordType1</code> and <code>RecordType2</code>. My question is how to go about fetching the second reference type while minimizing my requests/sec. I was looking at Apple's <a href="https://developer.apple.com/library/content/samplecode/CloudCaptions/Introduction/Intro.html" rel="nofollow noreferrer">CloudCaptions</a> sample, and they solve the problem by fetching the second record type when each of <code>RecordType1</code> is fetched. It seems that this needlessly creates fetch requests (1[<code>RecordType1</code>] + 25[<code>RecordType2</code>] = 26 requests). How can I reduce this? It seems like it should be possible in two requests (one for <code>RecordType1</code> and then one to fetch all the <code>RecordType2</code> associated with it).</p>
  
  <p><strong>UPDATE</strong>: <code>RecordType2</code> has a back reference to <code>RecordType1</code></p>