Here's how:
General CollectionView or TableView have their own click function, as follows:1, CollectionView-(void) CollectionView: (Uicollectionview *) CollectionView Didselectitematindexpath: (Nsindexpath *) indexpath{//Normally, cell is not a customUicollectionviewcell * Cell = (Uicollectionviewcell *) [CollectionView Cellforitematindexpath:indexpath];//that is the cell to be obtained//a custom cellTitleviewcell * Cell = (Titleviewcell *) [self collectionview:collectionview cellforitematindexpath:indexpath];//that is the cell to be obtained}2, TableView-(void) TableView: (UITableView *) TableView Didselectrowatindexpath: (Nsindexpath *) indexpath{//Non-custom cellUITableViewCell * Cell = (UITableViewCell *) [TableView Cellforrowatindexpath:indexpath]; //Custom CellNewstableviewcell * Cell = (Newstableviewcell *) [self Tableview:tableview Cellforrowatindexpath:indexpath];}
Just make a record!
iOS development--Tableview/collectionview get the cell currently clicked