Delta
Delta copied to clipboard
Update page control on games view
Just fixed page control alignment & add page control select action for iOS14
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.