Class: Debugmotion::Console

Inherits:
UIView
  • Object
show all
Defined in:
lib/debugmotion/console.rb

Instance Method Summary collapse

Instance Method Details

#append_text(text) ⇒ Object



12
13
14
15
# File 'lib/debugmotion/console.rb', line 12

def append_text(text)
  @text_view.text = "#{@text_view.text} \n #{text}"
  @text_view.scrollRangeToVisible(NSMakeRange(@text_view.text.length - 1, 1))
end

#initWithFrame(frame) ⇒ Object



5
6
7
8
9
10
# File 'lib/debugmotion/console.rb', line 5

def initWithFrame(frame)
  super
  move_me
  @text_view = text_view
  self
end

#touchesMoved(touches, withEvent: event) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/debugmotion/console.rb', line 17

def touchesMoved(touches, withEvent:event)
  touch = touches.anyObject
  previous_location = touch.previousLocationInView(self.superview )
  current_location = touch.locationInView(self.superview )
  center = self.center
  center.x += current_location.x - previous_location.x
  center.y += current_location.y - previous_location.y
  self.center = center
end