TabPageViewController
TabPageViewController copied to clipboard
current tab
how can i set current tab index?
You can use displayControllerWithIndex
.
i have made the func displayControllerWithIndex(index: Int, direction: UIPageViewControllerNavigationDirection, animated: Bool)
as public and tried to set the index as last index. But when i scroll to previous page it takes me directly to first page. my function call is tabPageViewController.displayControllerWithIndex(menuIndex, direction: UIPageViewControllerNavigationDirection.Forward, animated: true)
. Why do i need to set the direction here ?
someone can give an example???
Fixed version(0.2.0) has just released. Please use the latest one.
For example
let tc = TabPageViewController.create()
let vc1 = UIViewController()
let vc2 = UIViewController()
tc.tabItems = [(vc1, "First"), (vc2, "Second")]
tc.displayControllerWithIndex(1, direction: .Forward, animated: false)
This does not update tab bar?
ok, it works... but i have to initialize the component each time, if i have a global component only the first call of tc.displayControllerWithIndex works, the others fail