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

108 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 answers

0
Tony Montes 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