Closed crehbichler closed 4 years ago
@crehbichler 👍 sounds like something we should fix
I met this problem too, It seems that it has not been resolved yet? version: 3.2 Swift: 4.2
@msaps Is there any plan to fix this? Causes issues in one of my projects 😢
@jhmacdon sorry been really busy of late - will try and get time to work on it this week 👍
@msaps
For now I am using the following workaround.
var dataSource = []
//......
let index = 0
dataSource.insert(viewController, at: index)
pageViewController.reloadData()
pageViewController.scrollToPage(.at(index: index+1), animated: false)
If adding something to the beginning of the data source, I am calling reloadData()
which will reload the data source and then scrolling back to the current page without animation.
Hi,
so, let's say we have a
PageboyViewController
that is set up with 1 page. Then I am updating my input for thePageboyViewControllerDataSource
and callinginsertPage(at: 0, then: .doNothing)
.What I would expect is that the new page will be inserted right before my current ViewController but I'm staying at the current ViewController, because I've specified .doNothing as
PageUpdateBehavior
.What happens is that the new page is indeed inserted before my current ViewController, but also it "cross-dissolves" to the inserted ViewController.
I see that this is implemented in the
func performUpdates
when it's checked if newIndex == currentIndex and then the crossDissolve + updateViewControllers is done. I guess that totally makes sense for deleting the page at the currentIndex, but I'm not sure if this is the desired behaviour for inserting?Thanks in advance! (And thanks for building/improving this great library 👍 )
Version
Pageboy (3.2.0) (actually used with Tabman (2.3.0) but this should be just related to Pageboy)