TabPageViewController icon indicating copy to clipboard operation
TabPageViewController copied to clipboard

current tab

Open lucabecchetti opened this issue 8 years ago • 6 comments

how can i set current tab index?

lucabecchetti avatar May 27 '16 10:05 lucabecchetti

You can use displayControllerWithIndex.

EndouMari avatar Jun 07 '16 02:06 EndouMari

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 ?

aadilkeshwani90 avatar Jul 02 '16 07:07 aadilkeshwani90

someone can give an example???

lucabecchetti avatar Jul 08 '16 15:07 lucabecchetti

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)

EndouMari avatar Jul 15 '16 00:07 EndouMari

This does not update tab bar?

ibhupi avatar Aug 03 '16 08:08 ibhupi

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

lucabecchetti avatar Aug 04 '16 16:08 lucabecchetti