title: How to access variables within a subview of UITableViewCell contentView in iOS Swift Project
body: <p>I am working on a Swift iOS app with a <code>UITableView</code>.  I have used <code>XCode Storyboard</code> to add some labels to a prototype cell. I have also added a custom <code>UIView</code> class to the prototype cell. I can use <code>viewWithTag</code> to access the content of the labels, but I cannot access variables within my custom <code>UIView</code>. I need to pass in some integers so that the pie chart can be properly generated.</p>
  
  <p>The class of my custom view is:</p>
  
  <pre><code>class protoBubbleView: UIView {
  var necessaryInteger = 0
  </code></pre>
  
  <p>I have assigned it a tag of 9.  I try to access it in this way:</p>
  
  <pre><code>let lbl : protoBubbleView  = cell.viewWithTag(9)!
  lbl.necessaryInteger  = 5
  </code></pre>
  
  <p>But I receive errors indicating that viewWithTag only returns UIView and this cannot be assigned to lbl which is protoBubbleView.</p>
  
  <p>How can I access the variables within this subview?</p>
  
  <p>Thank you.</p>
  
  <p><a href="https://i.stack.imgur.com/kbxcv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kbxcv.jpg" alt="enter image description here"></a> </p>