Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to remove the last page #208

Closed
Mattijah opened this issue Mar 31, 2019 · 5 comments
Closed

Not possible to remove the last page #208

Mattijah opened this issue Mar 31, 2019 · 5 comments
Labels

Comments

@Mattijah
Copy link

Mattijah commented Mar 31, 2019

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 the viewController(for pageboyViewController:) will be called with an index of -1. Again, doesn't matter if I return nil or a blank VC. Nothing changes. *It should not be called with -1.

Calling reloadData doesn't help either.

Version: 3.1.0

@Mattijah Mattijah changed the title Not possible to remove last page Not possible to remove the last page Mar 31, 2019
@msaps msaps added the bug label Apr 8, 2019
@msaps
Copy link
Member

msaps commented Apr 8, 2019

@Mattijah will check it out 👍

@Coeur
Copy link
Contributor

Coeur commented Apr 22, 2019

@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:/uias/Pageboy/tree/feature/insertion-fix (still more to do)

@Mattijah
Copy link
Author

Mattijah commented Apr 23, 2019

@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.

@Coeur
Copy link
Contributor

Coeur commented Apr 24, 2019

My test was using the example app, which uses deletePage(at: index): https:/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.

@msaps
Copy link
Member

msaps commented May 4, 2019

@Mattijah @Coeur fixed in 3.2.2 🍾

@msaps msaps closed this as completed May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants