Closed Mattijah closed 5 years ago
@Mattijah will check it out 👍
@Mattijah, currently on master branch, I don't have your behavior; when I delete the last page, I get a Fatal error: Index out of range
. And this is partially fixed on the branch https://github.com/uias/Pageboy/tree/feature/insertion-fix (still more to do)
@Coeur I use Pageboy
as a part of Tabman
. I have just tried to delete the last page again, there is no error and the application continues running normally. The page (ViewController) is still displayed and present in the hierarchy. pageCount
returns the same number (1) after deletePage(at: 0, then: .doNothing)
was executed.
My test was using the example app, which uses deletePage(at: index)
: https://github.com/uias/Pageboy/blob/master/Example/Pageboy-Example/PageViewController+Bulletins.swift#L59
Well, anyway, crash or not, it's being acknowledged that there is a problem to solve there.
If there is only 1 page left, calling
deletePage
seems to have no effect at all. The view controller will still stay in, displayed. Is this an expected behaviour or a bug?On top of that, if I pass
.scrollToUpdate
theviewController(for pageboyViewController:)
will be called with an index of-1
. Again, doesn't matter if I returnnil
or a blank VC. Nothing changes. *It should not be called with-1
.Calling
reloadData
doesn't help either.Version: 3.1.0