The tvOS Apprentice book is really an outstanding title! However, there was something that I didn’t see covered in it and I haven’t found an answer to anywhere else.
I am showing a list of items using the TVML “Catalog” template. Users can delete items from the list, so I want to add a “shake” animation to a TVViewElement’s UIView when the user performs a “holdselect” action on it, like an app’s icon does when you’re about to delete it from the main Apple TV screen. I haven’t found built-in functionality that provides this behavior.
Based on what I learned from the tvOS Apprentice book, I think I need to call a Swift function from TVJS in response to the holdselect event being dispatched for a selected item. The Swift function will apply the animation to the selected item’s UIView. To do this, the UIView must be provided to it from TVJS or the UIView must be located given the selected TVViewElement. I don’t see a way to retrieve the UIView that is associated with a given TVViewElement.
Does anyone know how to do this? Feel free to suggest a different approach. Thanks!