title: How to unit test UITableView?
body: <p>I am trying to unit test UITableView but I have no idea how to do it. I have a view controller that has a table view in it. Each prototype cell has a custom table view cell class with outlets attached to it.</p>
  
  <p>Now, I want to test both of these components separately. Firstly, I want to test if the data inside the table view cell is correct by creating the prototype cell separately. Secondly, I want to populate my table view with random data and test whether the objects are correct etc. How can I do both of these?</p>
  
  <p>For testing the cell itself, I have no idea how to create the cell separately and check it by sending data to it. So, my custom class has small functions to set data to cell instead of directly assigning data to label, button, image. I want to test those functions. But I can't check it if I am not rendering it.</p>
  
  <p>For testing the components, my problem is different in the sense that, I want to change the data that is coming to it. So, instead of reading the data from API, I want to read it normally but I don't know how to change <code>viewDidLoad</code> to work with local objects instead of network objects.</p>