View list_events_screen.rb
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| |
View app_delegate.rb
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 |
View Rakefile
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} |
View afmotion_example.rb
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 |
View example_table_screen.rb
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" |
View potion-table-screen-generator.sh
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 |
View starting-ios-simulator.sh
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 |
View potion-new.sh
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! |
View install-redpotion.sh
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 |
View app_delegate.rb
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