Should I use a UITableView or UICollectionView to create this - ios

I would like to create the following, but not absolutely sure which one is the best to use: UITableView or UICollectionView?

Table views only do a single vertical list of cells. If you need a grid with rows and columns then you need a collection view.
If the 3 parts of your A-G rows are separate sections of single items then you might use a table view. (Say the left column contains an image, the middle column contains a title and subheading, and the right column contains a description of the item.)

Related

UITableView cells on the same row

as I say in the title, I'd like to display two or more cells on the same row. I have every cell with a UILabel inside. The labels can have changing width depending on user's input. I'd like to fill a row with many labels as I can. Can someone give me some advice on how to do it? Thanks.
Short answer: You can't. Slightly longer answer: Use a collection view.
Table views are designed to show a single column of cells.
You can't make a table view contain multiple cells in a row.
You could probably create a view controller that had side-by-side table views inside it, but it would be awkward and hard to use, and the table views would scroll independently of each other.
If you want multiple cells on the same row, you want a collection view. A collection view is similar to, but more flexible than, a table view.
I would consider using a horizontal UIStackView to achieve what you're trying to do. Depends on how dynamic and changeable you need it to be.

Pairs of cells in columns in a custom UICollectionView layout

I'm trying to make something like this with a collection view.
| imageview |
|label| |value|
|label| |value|
So far I have been able to display two sections (the first being the image view, the second being the label), but I'm lost at how to add a second column to the second section. I've been looking around for how to do this but all I've seen are how to make the same type of cell be displayed in columns.
Should these labels and values be different sections where I create different custom cells? And should I be using UICollectionViewFlowLayout to display the two different sections side by side?
You can make the image view a supplementary view of the collection view. Here is a tutorial that can show you how to do that.

Is a table view with custom cells still a plain table view?

Apple defines a plain table view like the following:
Plain. In the plain style, rows can be separated into labeled sections
and an optional index can appear vertically along the right edge of
the view. A header can appear before the first item in a section, and
a footer can appear after the last item.
Or in more detail:
A table view in the plain (or regular) style displays rows that
stretch across the screen and have a creamy white background (see
Figure 1-1). A plain table view can have one or more sections,
sections can have one or more rows, and each section can have its own
header or footer title. (A header or footer may also have a custom
view, for instance one containing an image). When the user scrolls
through a section with many rows, the header of the section floats to
the top of the table view and the footer of the section floats to the
bottom.
A variation of plain table views associates an index with sections for
quick navigation; Figure 1-2 shows an example of this kind of table
view, which is called an indexed list. The index runs down the right
edge of the table view. Entries in the index correspond to section
header titles. Touching an item in the index scrolls the table view to
the associated section. For example, the section headings could be
two-letter state abbreviations, and the rows for a section could be
the cities in that state; touching at a certain spot in the index
displays the cities for the selected state. The rows in indexed lists
should not have disclosure indicators or detail disclosure buttons,
because these interfere with the index.
Now you can have custom cells instead of the four default styles (Default, Subtitle, Value 1, Value 2). If you have a "crazy" custom cell is it still a "plain" table view? Or is it only valid for the default styles? Because the docs only shows the default styles on the screenshots.
The tableview style affects the table view — not the table view cells. So yes, a plain tableview can — and should have — custom cells.

custom uitableview section design

I would like to have a custom section design for my app.
The particular case would be to have a text displayed on the left of the section elements.
Could someone help? i've attached a image to better explain what i mean.
UPDATE 1
Let me elaborate: I would like to have a uitableview with N number of sections, each with variable number of elements per section. For each section, i would like to have a description on the left of the rows. The scroll show act as in any other uitableview.
You must have a table view, in each cell in the left side add a label and on the right side add a new tableview.

Tabular data iOS

I would like to display tabular data in a view in an iphone application.
The data i want to show is 10 columns wide and about 8 rows. The columns are mostly integers except for one column which will be a name. These 10 columns won't fit on the screen so i would include a scrolling view to allow users to scroll the table in a vertical direction to be able to view each column. But i can't figure out how to show multiple columns of data.
I've looked into Shinobigrids but this solution is quite expensive. Are there any other grids available which are open-source or are there any tutorials on how to build these yourself?
You can either create a single table view with custom cells, and each cell to have multiple columns, or add multiple tables to a UIScrollView (I'd prefer this one) and you can scroll each column individually.
Try using collectionView it displays a collection of cells through which users can scroll. Each cell in a collection view is a UICollectionViewCell object. Hope this helps you..;)

Resources