Skip to content

Instantly share code, notes, and snippets.

@ahmed-abdurrahman
Created May 2, 2017 11:43
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ahmed-abdurrahman/c7da6177babb39e13586458fa56acbd1 to your computer and use it in GitHub Desktop.
func displayCurrentTab(_ tabIndex: Int){
if let vc = viewControllerForSelectedSegmentIndex(tabIndex) {
self.addChildViewController(vc)
vc.didMove(toParentViewController: self)
vc.view.frame = self.contentView.bounds
self.contentView.addSubview(vc.view)
self.currentViewController = vc
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment