Skip to content

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