tableView左滑按钮

 

- (nullable NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(8_0) __TVOS_PROHIBITED; // supercedes -tableView:titleForDeleteConfirmationButtonForRowAtIndexPath: if return value is non-nil

此方法可自动以左滑时出现的按钮。

 

 iOS8.0以下调用-tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:来设置删除按钮的文字,8.0以上当- (nullable NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath返回为空或不写时,也是调用-tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:,但如果不空时,则不调用titlefor....而调用editActionFor....

 

 左滑时,tableView会调用

- (id)_titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath;

posted @ 2016-06-08 18:43  Emyin  阅读(301)  评论(0)    收藏  举报