Healthy way to approach focusable views inside each page of a UIPageViewController

Hi all,


Thank you for all of your support thus far. I'm currently stuck trying to understand how to manage focus in this situation:

I've created a horizontally scrolling UIPageViewController which is working great. I've added UIButton objects to each view controller acting as a 'page' of the UIPageViewController. Focus is stuck on the UIPageViewControllers' UIQueuingScrollView.


Is there any way to handle this beside setting the UIPageViewController's preferredFocusedView to being one of the buttons in the embed pages? When I go to a new page, is it expected behavior to setNeedsUpdateFocus back on the UIPageViewController to let it figure it out again?


I'm trying to implement this in a way to keep scrolling natural but easily allow for jumping into a small, page-specific menu of a couple UIButtons.


Thank you for your guidance!

Accepted Reply

UIPageViewController does not support view controllers with focusable content in them and are geared to be used to display non-interactive content like full screen photos.

Replies

UIPageViewController does not support view controllers with focusable content in them and are geared to be used to display non-interactive content like full screen photos.

Got it. Can I create something similar with a UICollectionViewController that has only one, long, paging row?


Thank you for your patience. Using tvOS is my first experience with Collection Views coming from always using vertical-scrolling TableViews on iOS.

I've got it! Horizontal instead of vertical for the flow layout direction. Thank you for your help!

Does that mean I can't even detect a simple CLICK on one of the photos?

(As a selection mechanism)?


I am trying to do this, but my tap recognizers are not seeing anything.


Bram

Right. The view controllers inside a UIPageViewController on tvOS are meant to display non-interactive content.


But! This might help you. This is how I implemented my interaction. All gesture recognizers are added to the UIPageViewController's view (instead of each page view controller), and based on the current page a customer is on, I transition and display the right overlay content in that view. So the UIPageViewController's view is acting as an overlay and knows how to display the right overlay content for a given page. Maybe a similar implementation will help you!