Hide empty cells in UITableView

后端 未结 7 825
春和景丽
春和景丽 2021-01-11 12:47

I have a searchable tableview, but would like to only display the number of cells that are returned once a user starts a search. For instance, if a user types in a charecter

7条回答
  •  太阳男子
    2021-01-11 13:21

    Change your implementation of tableView:numberOfRowsInSection: in your data source to return the number of search results instead of the total number of items. Then populate those cells with the search results instead of with the rest of the data.

提交回复
热议问题