title: How can I access UISegmentedControl in header of UICollectionViewController?
body: <p>So this problem is fairly straightforward. I have a <code>UICollectionViewController</code> <code>(MyProfile.swift)</code> with a header section <code>(MyProfileHeader.swift)</code>. Within the latter, I have a <code>UISegmentedControl</code> to return different numbers of items AND items in the <code>collection view cells</code> (I don't want to initialize an instance of the latter's class within the <code>UICollectionViewController</code>). This is my code for <code>MyProfile.swift class</code>. I tried adding a target in the <code>viewForSupplementaryElementOfKind</code> method to return different queries (which works), but I ultimately have to access the segmented control within the <code>numberOfItemsInSection</code> and <code>cellForItemAtIndexPath</code> methods. The <code>"testObjects"</code> and <code>"writeObjects"</code> are <code>array</code> values that are queried via the <code>addTarget</code> method in the <code>viewForSupplementaryElementOfKind</code>. I set the <code>indexPath</code> but it <code>returns</code> an <code>error</code> for obvious reasons... How can I access segmented control?</p>
  
  <pre><code>    override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
  
      var numberOfItems: Int? = 0
  
      let indexPath = NSIndexPath(forItem: 0, inSection: 0)
  
      let header = collectionView.dequeueReusableSupplementaryViewOfKind(UICollectionElementKindSectionHeader, withReuseIdentifier: "header", forIndexPath: indexPath) as! MyProfileHeader
  
  
      if header.userContent.selectedSegmentIndex == 1 {
          numberOfItems = textObjects.count
      } else if header.userContent.selectedSegmentIndex == 2 {
          numberOfItems = 0
      } else {
          numberOfItems = photoObjects.count
      }
  
  
  
      print("F: \(numberOfItems!)")
      return numberOfItems!
  }
  </code></pre>