Sha256: 6a611f73b521469b211b12ceb0097e638222ad4b2fec40e0201e881ba4dd3daf

Contents?: true

Size: 1.68 KB

Versions: 19

Compression:

Stored size: 1.68 KB

Contents

class MainController < UIViewController
  attr :welcome
  attr :button

  stylesheet :main

  layout :root do
    subview(CustomView, :background) do
      @welcome = subview(UILabel, :welcome)
      subview(UILabel, :footer)
      @button = subview(UIButton.buttonWithType(UIButtonTypeRoundedRect), :next_message)
    end

    @button.addTarget(self, action: :next_message, forControlEvents:UIControlEventTouchUpInside)
  end

  def next_view
  end

  def next_message
    msg = messages.shift
    if msg
      @welcome.text = msg
    else
      @welcome.text = 'Next example...'

      @button.removeTarget(self, action: :next_view, forControlEvents:UIControlEventTouchUpInside)
      @button.addTarget(self, action: :next_view, forControlEvents:UIControlEventTouchUpInside)
    end
  end

  def messages
    @messages ||= [
      'This is teacup',
      'Welcome',
      'This is teacup',
      'Welcome to teacup',
      'You can do anything at teacup',
      'Anything at all',
      'The only limit is yourself ',
      'Welcome to teacup',
      'Welcome to teacup',
      'This is teacup',
      'Welcome to teacup',
      'This is teacup, Welcome',
      'Yes, this is teacup',
      'This is teacup and welcome to you who have come to teacup',
      'Anything is possible at teacup',
      'You can to anything teacup',
      'The infinite is possible at teacup',
      'The unattainable is unknown at teacup',
      'Welcome to teacup',
      'This is teacup',
      'Welcome to teacup',
      'Welcome',
      'This is teacup',
      'Welcome to teacup',
      'Welcome to teacup',
    ]
  end

  def shouldAutorotateToInterfaceOrientation(orientation)
    autorotateToOrientation(orientation)
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
teacup-2.1.12 app/controllers/main_controller.rb
teacup-2.1.11 app/controllers/main_controller.rb
teacup-2.1.10 app/controllers/main_controller.rb
teacup-2.1.9 app/controllers/main_controller.rb
teacup-2.1.8 app/controllers/main_controller.rb
teacup-2.1.7 app/controllers/main_controller.rb
teacup-2.1.6 app/controllers/main_controller.rb
teacup-2.1.5 app/controllers/main_controller.rb
teacup-2.1.4 app/controllers/main_controller.rb
teacup-2.1.3 app/controllers/main_controller.rb
teacup-2.1.2 app/controllers/main_controller.rb
teacup-2.1.1 app/controllers/main_controller.rb
teacup-2.1.0 app/controllers/main_controller.rb
teacup-2.0.6 app/controllers/main_controller.rb
teacup-2.0.5 app/controllers/main_controller.rb
teacup-2.0.4 app/controllers/main_controller.rb
teacup-2.0.3 app/controllers/main_controller.rb
teacup-2.0.2 app/controllers/main_controller.rb
teacup-2.0.0 app/controllers/main_controller.rb