Make sure that we're running on ios6 or higher

This commit is contained in:
Mark Rickert
2013-05-06 13:41:19 -04:00
parent adfe258aab
commit f46aeea0d8
2 changed files with 1 additions and 27 deletions

View File

@@ -5,32 +5,6 @@ module ProMotion::MotionTable
@refresh.attributedTitle = NSAttributedString.alloc.initWithString("Pull to Refresh")
@refresh.addTarget(self, action:'refreshView:', forControlEvents:UIControlEventValueChanged)
self.refreshControl = @refresh
# @on_refresh = get_refreshable_block
# params[:content_controller] ||= params[:contentController]
# params[:data_source] ||= params[:searchResultsDataSource]
# params[:search_results_delegate] ||= params[:searchResultsDelegate]
# params[:frame] ||= CGRectMake(0, 0, 320, 44) # TODO: Don't hardcode this...
# params[:content_controller] ||= self
# params[:delegate] ||= self
# params[:data_source] ||= self
# params[:search_results_delegate] ||= self
# search_bar = UISearchBar.alloc.initWithFrame(params[:frame])
# search_bar.autoresizingMask = UIViewAutoresizingFlexibleWidth
# if params[:search_bar] && params[:search_bar][:placeholder]
# search_bar.placeholder = params[:search_bar][:placeholder]
# end
# @contacts_search_display_controller = UISearchDisplayController.alloc.initWithSearchBar(search_bar, contentsController: params[:content_controller])
# @contacts_search_display_controller.delegate = params[:delegate]
# @contacts_search_display_controller.searchResultsDataSource = params[:data_source]
# @contacts_search_display_controller.searchResultsDelegate = params[:search_results_delegate]
# self.table_view.tableHeaderView = search_bar
end
alias :makeRefreshable :make_refreshable

View File

@@ -7,7 +7,7 @@ module ProMotion::MotionTable
if self.class.respond_to?(:get_searchable) && self.class.get_searchable
self.make_searchable(content_controller: self, search_bar: self.class.get_searchable_params)
end
if self.class.respond_to?(:get_refreshable) && self.class.get_refreshable
if ios_version_greater_eq?("6.0") && self.class.respond_to?(:get_refreshable) && self.class.get_refreshable
self.make_refreshable
end
end