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

currentViewController is the same after deleting a page #289

Open
xinatanil opened this issue Aug 28, 2023 · 1 comment
Open

currentViewController is the same after deleting a page #289

xinatanil opened this issue Aug 28, 2023 · 1 comment

Comments

@xinatanil
Copy link

I'm trying to delete a page and refresh my UI immediately after that but I can't because currentViewController is still the same!

print(pageController.currentViewController) // 0x12cd093b0
pages.remove(at: index)
pageController.deletePage(at: index, then: .scrollToUpdate)
print(pageController.currentViewController) // 0x12cd093b0

Is there some kind of a completion handler? Or is this a bug?

@xinatanil
Copy link
Author

Okay, I see that internal method performUpdates(..., completion: ((Bool) -> Void)?) has a completion handler, and it would be very sweet if the completion handler was also provided for deletePage() and other methods.
Since I'm too lazy to fork the repo and do it myself, I'll just use DispatchQueue.main.asyncAfter(deadline: .now() + 0.25)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant