Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RedPotion Introduction

RedPotion Introduction

An introduction to using RedPotion. The power of RMQ and ProMotion.

willrax

May 13, 2015
Tweet

More Decks by willrax

Other Decks in Programming

Transcript

  1. class AppDelegate def application(application, didFinishLaunchingWithOptions:launchOptions) controller = TopicsScreen.alloc.init controller.title =

    "Application" controller.view.backgroundColor = UIColor.whiteColor navigation = UINavigationController.alloc .initWithRootViewController(controller) @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) @window.rootViewController = navigation @window.makeKeyAndVisible true end end
  2. class AppDelegate < PM::Delegate status_bar true, animation: :fade def on_load(app,

    options) open TopicsScreen.new(nav_bar: true) end end
  3. def table_data [{ title: "", cells: topics.map do |topic| {

    title: topic.title, subtitle: "Last Poster: #{topic.last_poster}", action: :open_profile, arguments: { topic: topic } } end }] end
  4. class UserScreenStylesheet < ApplicationStylesheet def root_view(style) style.background_color = color.white end

    def name_label(style) style.frame = { top: 90, from_right: 20, right_of_previous: 20, height: 150 } style.number_of_lines = 0 style.text_alignment = :left style.line_break_mode = :word_wrapping style.font = UIFont.boldSystemFontOfSize(25.0) end end
  5. class UserScreen < PM::Screen stylesheet UserScreenStylesheet def stylesheet build_initial_ui end

    def build_initial_ui append(UIImageView, :avatar_image) append(UILabel, :name) append(UILabel, :details_title) append(UILabel, :last_seen_at) end end