I have been looking around for solutions on how to do this but I am getting a bit confused.
I'd like to display tables of data 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 multiple tables like this in different pages, that I wish to style the same way, not all with the same number of rows or columns. 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)
Basically a table like this (I put this off Google Images because my data is confidential)
I have the theory on how to do this but I'm not sure it's right or exactly how to do it.
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.
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: http://www.raywenderlich.com/78550/beginning-ios-collection-views-swift-part-1 but it's with a UICollectionViewController and not a UICollectionView so I'm not sure how to tweak it.
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...)
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?
Let me know if anything is unclear. Thanks in advance.