3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'app/search_display.rb', line 3
def add_search_display
@search_bar = UISearchBar.alloc.initWithFrame([[0,0],[320,50]])
@search_bar.delegate = self
@search_bar.autocorrectionType = UITextAutocorrectionTypeNo
@search_bar.autocapitalizationType = UITextAutocapitalizationTypeNone
self.view.addSubview(@search_bar)
@search_display = UISearchDisplayController.alloc.initWithSearchBar(@search_bar, contentsController:self)
@search_display.delegate = self
@search_display.searchResultsDataSource = self
@search_display.searchResultsDelegate = self
@search_display.setActive(true, animated:true)
@search_bar.becomeFirstResponder
end
|