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

Update page control on games view #101

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

romaintalleu
Copy link

Just fixed page control alignment & add page control select action for iOS14

IMG_C47BB679A320-1

@ianclawson
Copy link

ianclawson commented Jul 15, 2021

Looking great! The only thing I can see to make this even sweeter would be to give pageControlValueChanged some logic to handle dynamic setViewControllers direction based on the PageControl direction rather than always pushing the new Page forward.

Something like adding a local private variable to track the last selected page index and checking against that would work:

var direction = UIPageViewController.NavigationDirection.forward

if let lastIndex = self.lastSelectedSectionIndex, lastIndex > sender.currentPage
{
    direction = .reverse
}

self.lastSelectedSectionIndex = self.pageControl.currentPage

pageViewController.setViewControllers([destinationViewController], direction: direction, animated: true) { [weak self] _ in

...

Either way this is a great addition! Thanks for opening it, hope to see it added to Delta one day.

JoeMatt added a commit to JoeMatt/Delta that referenced this pull request Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants