ios - How to append items to the bottom of the table or collection view ? -


i have swift table view/collection view. there anyway append items end of container ? upside down stack or ?

you need insert rows @ in uitableview , collection view first need insert in data source. tableview

//update data source object need add [tabledatasource addobject:newobject];  nsinteger row = [tabledatasource count]-1 ;//specify row need add new row in case last nsinteger section = //specify section new row added,  //section = 0 here since need add row @ first section  nsindexpath *indexpath = [nsindexpath indexpathforrow:row insection:section]; [self.tableview beginupdates]; [self.tableview insertrowsatindexpaths:@[indexpath] withrowanimation:uitableviewrowanimationright]; [self.tableview endupdates]; 

for collectionview

    [self.mycollectionview performbatchupdates:^{ [collectiondatasource addobject:newobject]; nsinteger row = [collectiondatasource count]-1 ;//specify row need add new row in case last              add new row in case last     nsinteger section = //specify section new row added,      //section = 0 here since need add row @ first section      nsindexpath *indexpath = [nsindexpath indexpathforrow:row insection:section];             [self.mycollectionview insertitemsatindexpath: indexpath];         } completion:nil]; 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -