Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.