Closed Sebacho-Barajas closed 7 years ago
Yes, good idea! Why use the TV Remote Menu Button to reveal/hide side view instead of gesture or button on screen? And if you have left and right side views?
you are right , i had to disable tap gesture because when I tap on the table cell it used to hide the menu, I had to use pan gesture to hide the menu.
Yes tap gesture is on the focus on tvOS. We'll see that, it's a good idea.
was testing pan gesture and it doesn't work once you are on the side menu, to dismiss it i have to select the cell
I did some tests. It seems that the menu (left side) should be opened if there is no left focus remaining in the main view. But if there is no focus left, methods shouldUpdateFocusInContext and didUpdateFocusInContext are not called. This is an example that opens the menu with the Menu button on the remote control and if the menu is open, the Menu button returns to the system. So I turned off the tap and pan for the TV! If you have any ideas, welcome ???
i tested it with a UITapGestureRecognizer , it worked fine and the Menu Button didn't return to the system.
- (void)viewDidLoad {
[super viewDidLoad];
UITapGestureRecognizer *tapGestureRec = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
tapGestureRec.allowedPressTypes = @[@(UIPressTypeMenu)];
[self.view addGestureRecognizer:tapGestureRec];
}
- (void)handleTap:(UITapGestureRecognizer *)recognizer {
if (self.isLeftViewOpen) {
[self revealLeftView];
} else {
[self revealLeftView];
}
}
we should add a tap gesture in the controller just for tvOS
//menu tap
I was thinking about adding a property in the Delegate to change which view you want to show with siri remote control, by default it will be added to left view
I added the menu Tap inside the controller for tvOS Target check my code : PBRevealViewController tvOS.zip
I know we can do that but this is not allowed by Apple:
Do you know an application with a left side menu on tvOS? In general, they use top shelf.
you're right , and what if we use another gesture for that? play/pause button or open menu with menu and close it with play/pause or swipe gesture
In my sample, you can show left menu if you press menu button and if left menu is open, if you press again menu button, the Apple tv home screen is shown. Is it not ok?
yes it works , what do you think about adding the UITapGestureRecognizer but with another button ?
I tried to reproduce the same behavior as the top shelf. I added two invisibles button for opening left and right view. For example, for the left view call [self tvOSLeftRevealButton]; This will create an invisible button and It will open the left view when it is focused by swiping. Also added swipe gesture recognizer to hide them. And the press menu button functionality for opening the left view and again to return to home screen. And using focus environment protocol methods to update the focus. What about this?
thanks I will test it and give you a feedback!
Ok. Can we continue this discussion via our email addresses? Mine is patrick.bodet4@wanadoo.fr
Rather, test this one. It is a better project with corrected bugs.
great, yes we can continue via our email mine is sebasbarajasc@gmail.com
just tested it and it works perfectly!
i got it to work on my tvOS app , I used #if TARGET_OS_IOS for tvOS prohibited iOS properties , but It would be great if you added full support for tvOS , I'm sure many users would love to use this library on their tvOS apps , we could use the tv remote button 'Menu' to show and hide the RevealView.