Tutorial by Examples

Subclassing UIControl gives us access to the following methods: beginTrackingWithTouch is called when the finger first touches down within the control's bounds. continueTrackingWithTouch is called repeatedly as the finger slides across the control and even outside of the control's bounds. endTr...
Swift let viewController = UIViewController() Objective-C UIViewController *viewController = [UIViewController new];
Swift class FooViewController: UIViewController { override func loadView() { view = FooView() } }
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; With an Identifier: Give the scene a Storyboard ID within the identity inspector of the storyboard. Instantiate in code: UIViewController *controller = [storyboard instantiateViewControllerWithIdentifi...
When the view controller is presented within a tab bar controller, you can access the tab bar controller like this: Swift let tabBarController = viewController.tabBarController Objective-C UITabBarController *tabBarController = self.tabBarController; When the view controller is part on an n...
To add a child view controller: - (void)displayContentController:(UIViewController *)vc { [self addChildViewController:vc]; vc.view.frame = self.view.frame; [self.view addSubview:vc.view]; [vc didMoveToParentViewController:self]; } To remove a child view controller: - (void)hid...

Page 1 of 1