How do I open the first cell in Modern Collection Views programmatically?

150 Views Asked by At

Playing around with Modern Collection Views, I managed to create a custom UIContentView. Great. Now I would like to open the first cell/row programmatically. How do I go about doing that? This is what I would like to see on startup. enter image description here

Thanks in advance for any hints.

1

There are 1 best solutions below

0
On

Thank you Lee Kah Seng for pointing me in the right direction. I ended up with:

    addItems(menuItems, to: nil)

    // expand first section
    snapshot.expand([menuItems[0]])

    return snapshot