Class: FirstController

Inherits:
UIViewController show all
Defined in:
app/controllers/first_controller.rb

Instance Method Summary collapse

Methods inherited from UIViewController

#autorotateMask, #autorotateToOrientation, layout, #layoutDidLoad, stylesheet, #stylesheet=, #top_level_view, #viewDidLoad, #willAnimateRotationToInterfaceOrientation

Methods included from Teacup::Layout

#layout, #stylesheet, #stylesheet=, #subview

Instance Method Details

#messagesObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'app/controllers/first_controller.rb', line 31

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

#next_messageObject



19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/first_controller.rb', line 19

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

#next_viewObject



16
17
# File 'app/controllers/first_controller.rb', line 16

def next_view
end

#shouldAutorotateToInterfaceOrientation(orientation) ⇒ Object



61
62
63
# File 'app/controllers/first_controller.rb', line 61

def shouldAutorotateToInterfaceOrientation(orientation)
  autorotateToOrientation(orientation)
end