Skip to content

Instantly share code, notes, and snippets.

@rattlion
Created December 5, 2014 21:59
Show Gist options
  • Save rattlion/f29daad7b97f70516737 to your computer and use it in GitHub Desktop.
Save rattlion/f29daad7b97f70516737 to your computer and use it in GitHub Desktop.
class HomeViewController < UITabBarController
def loadView
super
list_view_controller = ListViewController.alloc.init
profile_view_controller = ProfileViewController.alloc.init
self.setViewControllers([list_view_controller,
profile_view_controller], animated:true)
end
end
class ProfileViewController < UIViewController
def loadView
super
self.title = "Profile"
self.view = UIView.alloc.initWithFrame(UIScreen.mainScreen.bounds)
self.tabBarItem = UITabBarItem.alloc.initWithTabBarSystemItem(UITabBarSystemItemContacts, tag:1)
end
def viewDidLoad
super
self.view.backgroundColor = UIColor.whiteColor
end
end
@rattlion
Copy link
Author

rattlion commented Dec 5, 2014

self.viewControllers.each { |view_controller| view_controller.view } gets the desired effect, but feels dirty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment