title: Pass parameter to selector function in Swift
body: <p>I would like to pass a <em>parameter</em> to a function called as a <em>selector</em> from a <em>timer</em>.  Specifically the reference to a <code>cell</code> so i can update something in the <em>UI</em>.</p>
  
  <p>So what I want to something like this:</p>
  
  <pre><code>timer = Timer.init(timeInterval: 1.0, target: self, selector: #selector(downloadTimer(cell: cell), userInfo: nil, repeats: true)
  </code></pre>
  
  <p>Function</p>
  
  <pre><code>func downloadTimer(cell: InnerCollectionCell) {
      cell.progressBar.setProgress(downloadProgress, animated: true)
  }
  </code></pre>
  
  <p>Though I might be a bit niece in assuming this can be done?</p>
  
  <p>------ EDIT ------</p>
  
  <p>As per the below examples, but not getting expected results as usual from a cell</p>
  
  <pre><code>let innerCell: InnerCollectionCell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifierInner, for: indexPath) as! InnerCollectionCell
  
  timer = Timer.init(timeInterval: 1.0, target: self, selector: #selector(downloadTimer(_:)), userInfo: innerCell, repeats: true)
  
  
  func downloadTimer(_ timer: Timer) {
  
      let cell = timer.userInfo
  
      cell. // no options as expected of a cell
  
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/pYhht.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pYhht.png" alt="enter image description here"></a></p>
  
  <p>I expected more options like this if the data was sent correctly:</p>
  
  <p><a href="https://i.stack.imgur.com/1zIaE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1zIaE.png" alt="enter image description here"></a></p>