Merge pull request #628 from squidpunch/fix-search-height

Adds delegate to set height of search results
This commit is contained in:
Jamon Holmgren
2015-02-23 09:15:12 -08:00
2 changed files with 10 additions and 0 deletions

View File

@@ -57,6 +57,10 @@ module ProMotion
self.table_view.setScrollEnabled false
@table_search_display_controller.delegate.will_begin_search if @table_search_display_controller.delegate.respond_to? "will_begin_search"
end
def searchDisplayController(controller, didLoadSearchResultsTableView: tableView)
tableView.rowHeight = self.table_view.rowHeight
end
end
end
end

View File

@@ -52,4 +52,10 @@ describe "Searchable table spec" do
controller.will_end_search_called.should == true
end
it "should set the row height of the search display to match the source table row height" do
tableView = UITableView.alloc.init
tableView.mock!(:rowHeight=)
controller.searchDisplayController(controller, didLoadSearchResultsTableView: tableView)
end
end