Giter Site home page Giter Site logo

Comments (18)

iDevelopper avatar iDevelopper commented on July 22, 2024 1

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?

from pbrevealviewcontroller.

iDevelopper avatar iDevelopper commented on July 22, 2024 1

Yes tap gesture is on the focus on tvOS. We'll see that, it's a good idea.

from pbrevealviewcontroller.

iDevelopper avatar iDevelopper commented on July 22, 2024 1

I know we can do that but this is not allowed by Apple:

2017-02-14_07-25-53

from pbrevealviewcontroller.

Sebacho-Barajas avatar Sebacho-Barajas commented on July 22, 2024

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.

from pbrevealviewcontroller.

Sebacho-Barajas avatar Sebacho-Barajas commented on July 22, 2024

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

from pbrevealviewcontroller.

iDevelopper avatar iDevelopper commented on July 22, 2024

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 ???

PBRevealTVOS.zip

from pbrevealviewcontroller.

Sebacho-Barajas avatar Sebacho-Barajas commented on July 22, 2024

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
#if TARGET_OS_TV
//menu tap
#endif

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

from pbrevealviewcontroller.

Sebacho-Barajas avatar Sebacho-Barajas commented on July 22, 2024

I added the menu Tap inside the controller for tvOS Target
check my code :
PBRevealViewController tvOS.zip

from pbrevealviewcontroller.

iDevelopper avatar iDevelopper commented on July 22, 2024

Do you know an application with a left side menu on tvOS? In general, they use top shelf.

from pbrevealviewcontroller.

Sebacho-Barajas avatar Sebacho-Barajas commented on July 22, 2024

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

from pbrevealviewcontroller.

iDevelopper avatar iDevelopper commented on July 22, 2024

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?

from pbrevealviewcontroller.

Sebacho-Barajas avatar Sebacho-Barajas commented on July 22, 2024

yes it works , what do you think about adding the UITapGestureRecognizer but with another button ?

from pbrevealviewcontroller.

iDevelopper avatar iDevelopper commented on July 22, 2024

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?

PBRevealTVOS 2.zip

from pbrevealviewcontroller.

Sebacho-Barajas avatar Sebacho-Barajas commented on July 22, 2024

thanks I will test it and give you a feedback!

from pbrevealviewcontroller.

iDevelopper avatar iDevelopper commented on July 22, 2024

Ok. Can we continue this discussion via our email addresses? Mine is [email protected]

from pbrevealviewcontroller.

iDevelopper avatar iDevelopper commented on July 22, 2024

Rather, test this one. It is a better project with corrected bugs.

PBRevealTVOS 3.zip

from pbrevealviewcontroller.

Sebacho-Barajas avatar Sebacho-Barajas commented on July 22, 2024

great, yes we can continue via our email mine is [email protected]

from pbrevealviewcontroller.

Sebacho-Barajas avatar Sebacho-Barajas commented on July 22, 2024

just tested it and it works perfectly!

from pbrevealviewcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.