Modern Collection Views With Custom Xib Cell

Hi, I'm trying to implement Modern Collection Views from the Apple Developer documentation linked. What I need is expandable/collapsible cells just like in the OutlineViewController but with custom Xib cells. Somehow I'm able to display my Xib cell in the collection view but it is no expanding/collapsing need some help on how to proceed further.

Thanks in advance!

Modern Collection Views With Custom Xib Cell
 
 
Q