title: Add UICollectionView in UICollectionViewCell
body: <p>I am using Swift to build an iOS application for the Hospital I work at.</p>
  
  <p>Somehow, in a specific feature I have to put a <code>UICollectionView</code> inside the <code>UICollectionViewCell</code>. The one I want to achieve was for every content of the parent <code>UICollectionView</code> (vertical scrolling) would have several children (Which can be scrolled horizontal) depending on the parent row.</p>
  
  <p>For illustration, I have to display list of doctors (name &amp; photo) and then I have to display each of the practice schedule of them below their name and photo. The practice schedule would vary depending on each doctor. So, I have to put it inside the <code>UICollectionView</code>.</p>
  
  <p>I have tried several solutions that I found on the web, but I still cannot approach it.</p>
  
  <p>The most problem that I can't solve was: I don't know where is the place in the code to load the child data source (doctor schedule) and when I could load it, because I can't have two functions like below:  </p>
  
  <pre><code>collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell
  </code></pre>
  
  <p>this is the one I want to achieve</p>
  
  <p><a href="https://i.stack.imgur.com/1sEqz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1sEqz.png" alt="design of collection view"></a></p>
  
  <p>the <code>UIImage</code> and doctor name (<code>UILabel</code>) was in the parent <code>UICollectionViewCell</code> (scroll vertically), and then everything in the box (practice day n practice time) are the child <code>UICollectionView</code> (scroll horizontally)</p>
  
  <p>PS: there are many doctors, and each of the doctor has several practice day.</p>
  
  <p>please help me how to do this</p>