title: Display a table (in the html/Excel spreadsheet meaning) in a iOS app in Swift
body: <p>I have been looking around for solutions on how to do this but I am getting a bit confused.</p>
  
  <p>I'd like to <strong>display tables of data</strong> in my app, not in the sense of Apple's TableView, more like tables you find in Excel or the  in HTML.
  Moreover in my app I will have <strong>multiple tables</strong> like this in different pages, that I wish to <strong>style the same way</strong>, <strong>not all with the same number of rows or columns</strong>. Those tables might be displayed on the screen alongside images or texts, probably never on their own. (so I need an element I can put in a UIViewController)</p>
  
  <p>Basically a table like this (I put this off Google Images because my data is confidential)
  <a href="https://i.stack.imgur.com/9yhwx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9yhwx.png" alt="enter image description here"></a></p>
  
  <p>I have the theory on how to do this but I'm not sure it's right or exactly how to do it.</p>
  
  <p>My theory is I should create a subclass of UICollectionView, let's call it MyTablesView. MyTablesView would have a variable named data. My pages/VC that contain a table will have an instance of MyTablesView and feed it data in this variable. MyTablesView takes care of styling and displaying this data.</p>
  
  <p>I'm fairly new to Swift and I don't know exactly so I'm not sure on how to tackle this. I am very confused on how to code a UICollectionView. I tried to read this tutorial: <a href="http://www.raywenderlich.com/78550/beginning-ios-collection-views-swift-part-1" rel="noreferrer">http://www.raywenderlich.com/78550/beginning-ios-collection-views-swift-part-1</a> but it's with a UICollectionViewController and not a UICollectionView so I'm not sure how to tweak it.</p>
  
  <p>So for now this is all I have...
      class MyTablesView: UICollectionView{
        var data = [String]
      }
  (I put string for now because I'm not 100% sure of the data that would be in the tables, it will probably end up being doubles, but I'll also need something for headers...)</p>
  
  <p>So I guess my question is:
  How do I subclass a UICollectionView properly to display the data that will be given to it by a ViewController?</p>
  
  <p>Let me know if anything is unclear.
  Thanks in advance.</p>