I am trying to setup an UIButton that click it would add a new section into my UICollectionView. I've searched for some examples online, but could make them work. Following is one of the answers which looks fine, but still not working for me.
Am I missing something? Could anyone provide some help? Many thanks in advance!
func buttonAction(sender:UIButton!) {
var paths = [NSIndexPath]()
paths.append(NSIndexPath(forRow: 0, inSection: 0))
self.table.insertItemsAtIndexPaths(paths)
}