1

I have a large list of data in my Collection View, the number of rows and columns are dynamic, they change when I push a button to filter.

I've created my Collection View programatically, all the data become from my server and even the titles of the header.

My server can return, for example:
Code   | Name      | Phone         | Address                              | Others columns until the end ...

2          | Eevee     | 876321342 | In a big commercial center  |
10        | Mewtwo  | 673812332 | In a cave                              |
...
...

Well, my problem is, I don't know how to create a header programatically, so I think is possible convert my first row of my Collection View as a header row and make it sticky, or, another way to make it fixed, taking into account whenever I have to scroll horizontal and vertical of course.

Is there any way to do that?

PS: My app is not about pokemon, so do not try to call Mewtwo please (:

bey23
  • 313
  • 4
  • 16
  • Take a look here: https://cocoacasts.com/how-to-add-sticky-section-headers-to-a-collection-view/ – GetSwifty Mar 20 '17 at 17:10
  • 2
    Possible duplicate of [UICollectionView sticky header in swift](http://stackoverflow.com/questions/27316263/uicollectionview-sticky-header-in-swift) – Ahmad F Mar 20 '17 at 17:15
  • @AhmadF No, I already tried it days ago, from that link. That way doesn't work when I refresh all the data (included headers) which I returned from server and rewrite it in my CollectionView. I put the two lines after .reloadData() when press the button and didn't work. – bey23 Mar 21 '17 at 06:59

0 Answers0