title: How to call index on UICollectionView using IBAction?
body: <p>I am trying to put bunch of options on UICollectionView using IBAction as a trigger to open it each option, but I have difficulty what code should I call to trigger my action using IBAction. Here is my code: </p>
  
  <pre><code>@IBAction func openNewFilter(sender: AnyObject) {
      self.collectionView.dataSource = indexPath.section == 0
  }
  
  func numberOfSections() -&gt; Int { 
      return 2
  }
  
  func numberOfItemsInSection(_ section: Int) -&gt; Int {
      if section == 0 
      {
          return array.count
      } 
      else if section == 1
      { 
          return 1
      } 
      else
      {
          return 0
      }
  }
  
  
  func cellForItemAtIndexPath(_ indexPath: NSIndexPath) -&gt; UICollectionViewCell?    {
      if indexPath.section == 0 
      {
  
      } 
      else if indexPath.section == 1 
      {
  
      }
  }
  </code></pre>
  
  <p>I would appreciate it if you could help me, Thanks..!! </p>