Instead of using UITableView or UICollectionView use this for
expand/collapse behaviour.
Implementation higly mimics UICollectionView. Its more easy because
just waits the headers and their expanding items which are any UIView
type object -
View it on GitHub