How to automatically add lines (label) to an Uicollection in Swift?

Asked

Viewed 101 times

1

In my application I managed to use Uicollection to show a "table" with horizontal scrolling containing the purchase information of the customer with header, but now I have another question, I need this table to be fed to each new password added. With Uicollection, I added 2 label, one with the header (CPF, NAME, etc), another with the information of the call on the server for each password chosen, that is, if the user buys a password and before closing the request choose one more password, the table should contain the header and two more lines with the password information (plus a label), as I add lines (label) automatically in Uicollection as in a Windows tableas the information array (amount of passwords) grows? Below is a picture of the table that is working, but needs to be fed:

Tabela de senhas

  • Really confused to understand well what you want, did and want to do... But I still believe that for what you want to do the tableview is still easier to use, but if you want to insist on Uicollectionview, create only a Cell (item) customized and create a Uicollectionviewcell class to take care of it, returning to each label the results of the array.

1 answer

0

I don’t know if this is what you want, but you can put a Uitableview inside a Uicollectionview. The side navigation is on account of Collectionview and within each tab you place the Tableview with A section and N lines, added dynamically according to the need.

Here is a sample code in Objective C for what I commented, just add the section as grouped to work as header. https://github.com/lequysang/github_zip/blob/master/TableViewInCollection.zip

Browser other questions tagged

You are not signed in. Login or sign up in order to post.