Sha256: bba9c35289d769b6ed94a10d7412b3ec8ae01d23aed19c1ac6a0dc0d4471c6e8

Contents?: true

Size: 1.65 KB

Versions: 17

Compression:

Stored size: 1.65 KB

Contents

class FirstController < UIViewController

  stylesheet :first

  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

17 entries across 17 versions & 1 rubygems

Version Path
teacup-1.3.4 app/controllers/first_controller.rb
teacup-1.3.3 app/controllers/first_controller.rb
teacup-1.3.2 app/controllers/first_controller.rb
teacup-1.3.1 app/controllers/first_controller.rb
teacup-1.3.0 app/controllers/first_controller.rb
teacup-1.2.9 app/controllers/first_controller.rb
teacup-1.2.8 app/controllers/first_controller.rb
teacup-1.2.7 app/controllers/first_controller.rb
teacup-1.2.5 app/controllers/first_controller.rb
teacup-1.2.4 app/controllers/first_controller.rb
teacup-1.2.3 app/controllers/first_controller.rb
teacup-1.2.2 app/controllers/first_controller.rb
teacup-1.0.4 app/controllers/first_controller.rb
teacup-1.0.3 app/controllers/first_controller.rb
teacup-1.0.2 app/controllers/first_controller.rb
teacup-1.0.1 app/controllers/first_controller.rb
teacup-1.0.0 app/controllers/first_controller.rb