This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListEventsScreen < PM::TableScreen | |
title "Upcoming Events" | |
def on_load | |
@events = [] | |
load_events | |
end | |
def load_events | |
AFMotion::JSON.get("http://calagator.org/events.json") do |response| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppDelegate < PM::Delegate | |
def on_load(app, options) | |
open ListEventsScreen.new(nav_bar: true) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.info_plist['NSAppTransportSecurity'] = {'NSAllowsArbitraryLoads' => true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AFMotion::JSON.get("http://calagator.org/events.json") do |response| | |
if response.success? | |
# do something with the response.object | |
else | |
# display an error message to the user | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExampleTableScreen < PM::TableScreen | |
title "The title of our screen in the nav bar" | |
def on_load | |
# do some setup here | |
end | |
def table_data | |
[{ | |
title: "Section title goes here" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ potion g table_screen list_events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd calagator | |
$ bundle exec rake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ potion new calagator | |
Creating app... | |
Running bundle... | |
Installing CocoaPods... | |
Installation complete! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gem install redpotion | |
Successfully installed redpotion-1.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
rootViewController = UIViewController.alloc.init | |
rootViewController.title = 'my_first_rm_app' | |
rootViewController.view.backgroundColor = UIColor.whiteColor | |
navigationController = UINavigationController.alloc.initWithRootViewController(rootViewController) | |
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
@window.rootViewController = navigationController |
NewerOlder