womblerone
womblerone

Reputation: 532

iOS swift options for spreadsheet tables

I'm new to Xcode but have been able to overcome every hurdle so far. Now I'm at a fork in the road and not sure which direction to go. My iPad app takes user input and then it generates reports based on the input. I want the reports to have as many columns as my entities have attributes, and for each attribute to be a column header and to be sortable, just like a spreadsheet. UITableview seems to let me display a dynamic number of rows, and then if I have a custom cell with several manually created labels mapped to attributes I could sort of simulate columns by having a bunch of buttons on a navigation bar that change how the table is sorted. Problem here is that if I change my data schema i need to redesign the cell view and write new code for for the sort columns. HTML also seems like an option, but it feels and looks very different for the user. There's also 3rd party, but stubbornly, I want to build it myself. Could you guys provide some guidance on the pros and cons of each option for my use case? If I go for the first one, is it possible (feasible) to write something that could auto generate the storyboard layout in the case of adding a new attribute to an entity? Platform: iPad, Language: swift, data set is not enormous (sub 100k rows, worst case), using core data, need flexibility on the reporting side - would love an interface that lets users generate their own reports (don't want my life to become custom reporting)

Upvotes: 3

Views: 7042

Answers (1)

Steve Rosenberg
Steve Rosenberg

Reputation: 19524

Are you familiar with the UICollectionView class?

Take a look at this example over at github:

https://github.com/darrarski/DRCollectionViewTableLayout-iOS

This is an excellent way to organize cells as in a spreadsheet.

There is a nice swift tutorial over here:

https://github.com/darrarski/DRCollectionViewTableLayout-iOS

Upvotes: 5

Related Questions