Class: MainViewController

Inherits:
UIViewController
  • Object
show all
Defined in:
app/app_delegate.rb

Instance Method Summary collapse

Instance Method Details

#grouped_tableObject



82
83
84
# File 'app/app_delegate.rb', line 82

def grouped_table
  push TestViewController
end

#popObject



89
90
91
# File 'app/app_delegate.rb', line 89

def pop
  self.navigationController.popViewControllerAnimated(true)
end

#pop_allObject



92
93
94
# File 'app/app_delegate.rb', line 92

def pop_all
  UIApplication.sharedApplication.delegate.initial_view
end

#push(view_class) ⇒ Object



85
86
87
88
# File 'app/app_delegate.rb', line 85

def push(view_class)
  view = view_class.alloc.initWithNibName(nil, bundle: nil)
  self.navigationController.pushViewController(view, animated: true)
end

#viewDidLoadObject



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'app/app_delegate.rb', line 53

def viewDidLoad
  super
  self.title = "MotionTable"
  rightButton = UIBarButtonItem.alloc.initWithTitle("Table Demo", style: UIBarButtonItemStyleBordered, target: self, action: 'grouped_table')
  self.navigationItem.rightBarButtonItem = rightButton

  self.view.backgroundColor = UIColor.whiteColor

  @motionTableLabel = UILabel.alloc.initWithFrame(CGRectMake(20, 10, 90, 40))
  @motionTableLabel.text = "MotionTable"
  @motionTableLabel.textColor = UIColor.blueColor
  @motionTableLabel.sizeToFit
  
  @colon = UILabel.alloc.initWithFrame(CGRectMake(115, 10, 10, 10))
  @colon.text = "::"
  @colon.textColor = UIColor.grayColor
  @colon.sizeToFit
  
  @groupedTableLabel = UILabel.alloc.initWithFrame(CGRectMake(125, 10, 90, 40))
  @groupedTableLabel.text = "GroupedTable"
  @groupedTableLabel.textColor = UIColor.greenColor
  @groupedTableLabel.sizeToFit
  
  self.view.addSubview @motionTableLabel
  self.view.addSubview @colon
  self.view.addSubview @groupedTableLabel
end