Skip to content

Incorrect behaviour when calling insertPage at currentIndexΒ #211

@crehbichler

Description

@crehbichler

Hi,

so, let's say we have a PageboyViewController that is set up with 1 page.
Then I am updating my input for the PageboyViewControllerDataSource and calling insertPage(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)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions