tvOS pressesEnded never called when pressing the Menu button on the remote in simulator?

I have an initial UIViewController which presents a another UIViewController modally via a segue. This second view controller holds a SpriteKit SKScene & SKView.

I am trying to intercept when the Menu button on the remote is pressed so that I can either pause the game if it's being played or exit out to the initial UIViewController (main menu) if the game is already paused. To do this I have subclassed the SKView and added overrides for pressesBegan and pressesEnded WITHOUT calling super.pressesBegan or super.pressesEnded in each so that it shouldn't get passed up the responder chain & exit out to the initial UIViewController when the menu button is pressed.


However when the Menu button is pressed pressesBegan gets called and the SKView exits-out to the initial UIViewController and pressesEnded in the SKView subclass never gets called. pressesCancelled does though. However, when I set a breakpoint inside pressesBegan & step through, pressesEnded DOES get called & it does not exit-out to the initial UIViewController, which is the expected behaviour! Why is this happening & how do I stop the SKView from exiting back to the previous UIViewController when I am not forwarding pressesBegan etc back up the responder chain?

Replies

Hey,

same issue here but also with AppleTV.


I will test some stuff, but pressesEnded is call with other remote button. Maybe controller is dismiss therefore callback pressesEnded can't be called anymore?


Pierre