Skip to content

Instantly share code, notes, and snippets.

@jamonholmgren
Created February 21, 2013 18:03
Show Gist options
  • Save jamonholmgren/5006748 to your computer and use it in GitHub Desktop.
Save jamonholmgren/5006748 to your computer and use it in GitHub Desktop.
search_modules_screen.rb
class SearchModulesScreen < ProMotion::TableScreen
title "Modules"
# ...
def table_data
@modules ||= []
[{
title: "",
cells: @modules.map do |m|
{
title: m['code'],
subtitle: m['title'],
accessoryType: (@my_modules[m['code']) ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone
}
end
}]
end
# ...
def will_appear
# ...
BubbleWrap::HTTP.get("http://127.0.0.1/OUJSON/modules.php") do |response|
@modules = BubbleWrap::JSON.parse response.body.to_str
update_table_data
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment