mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-05-29 16:06:31 +08:00
Scroll the tableview all the way to the top when there's a search field and the table index begins with "{search}". Fixes #159 on MASTER branch.
This commit is contained in:
@@ -139,6 +139,17 @@ module ProMotion
|
||||
end
|
||||
end
|
||||
|
||||
def tableView(tableView, sectionForSectionIndexTitle:title, atIndex:index)
|
||||
return index unless ["{search}", UITableViewIndexSearch].include?(self.table_data_index[0])
|
||||
|
||||
if index == 0
|
||||
tableView.setContentOffset(CGPointZero, animated:false)
|
||||
NSNotFound
|
||||
else
|
||||
index-1
|
||||
end
|
||||
end
|
||||
|
||||
def deleteRowsAtIndexPaths(indexPaths, withRowAnimation:animation)
|
||||
PM.logger.warn "ProMotion expects you to use 'delete_cell(index_paths, animation)'' instead of 'deleteRowsAtIndexPaths(indexPaths, withRowAnimation:animation)'."
|
||||
delete_cell(indexPaths, animation)
|
||||
|
||||
Reference in New Issue
Block a user