title: Transfer data from a UITableCellView and UITableView
body: <p>I have a UITableViewController with its own class <em>HomeVC</em>, containing multiple Cells, one of which uses its own class <em>NewsFeedCell</em>. This cell contains a vertical UIScrollView that displays pics. I want the user to, when he clicks the the row, trigger a segue to a VC with the picture. I created a <em>currentPage</em> variable in <em>NewsFeedCell</em> class, which obviously shows which page, and which picture, is the UIScrollView showing.</p>
  
  <p>In the <em>HomeVC</em>, i have this:</p>
  
  <pre><code>class HomeVC: UITableViewController {
  (...)
  override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
   (...)   
   if indexPath.row == 0 { //The cell containing the UIScrollView
          print(NewsFeedCell.currentPage) // I used "print" to simply the shown code 
      }
    }
  }
  </code></pre>
  
  <p>The problem is that xcode gives me an error saying <strong><em>Instance member "currentPage" cannot be used on type "NewsFeedCell"</em></strong>.</p>
  
  <p>I tried printing the value of currentPage to the console in the code of <em>NewsFeedCell</em>, and it worked.</p>
  
  <p>Btw, the variable is declared inside the <em>NewsFeedCell</em> and has its first value assigned under <strong><em>awakeFromnNib()</em></strong> to 0, and the second  time under:</p>
  
  <pre><code>func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView){
      currentPage = Int(floor((scrollView.contentOffset.x - cellWidth / 2) / cellWidth)) + 1
      print(currentPage)
  }
  </code></pre>
  
  <p>Please HELP!</p>