How to get indexPath.row of tableView which is currently being displayed?

前端 未结 5 2059
执笔经年
执笔经年 2021-01-02 05:19

I have a tableView with many values.

I want to get the first indexPath.row value of the table which is being displayed currently.

How can I do

5条回答
  •  情深已故
    2021-01-02 05:50

    you can use indexPathsForVisibleRows

    Returns an array of index paths each identifying a visible row in the receiver.

    - (NSArray *)indexPathsForVisibleRows
    

    Return Value

    An array of NSIndexPath objects each representing a row index and section index that together identify a visible row in the table view. Returns nil if no rows are visible.

提交回复
热议问题