How to animate a collection section title in a tvOS application?

enter image description here You need to animate the title of the section title when the collection cell below the title is focused. Just as if you go to the movies itunes app on an Apple TV and go to the best movies tab if you look at the playlists below when you view items, the animation heading is up and down so as not to overlap with the focused cell. any help welcome link to tvos screenshot

+8
ios tvos swift tv
source share
1 answer

I cannot provide the code exactly; but thatโ€™s basically what you want to do.

1 - create an intermediate class headingRouter ; whose goal will be to mediate between the scrollView header (collectionView or tableView) and cell selection. The header router instance will live in your main collectionView level methods.

2 - headers and footers - this is what is called supplementary view ; therefore, they can be assigned any custom uiView subclass. In this headerView; you should have a method that accepts an identifier, perhaps id and changes the displayed image. You can animate this change with a fade out if you want it to look like iTunes.

3 - On your focused cell section; cellForRowAt cells have an identifier that is assigned during the cellForRowAt method in your delegate / data source methods. When a particular look is focused; Using one of the various collection / tableView methods You want to take this identifier; transfer it to your headingRouter , which in turn will notify your header to change its image to the corresponding image (possibly stored in the cache) for the image you are focusing.

This is more of an implementation logic; but you havenโ€™t published any code, so thereโ€™s no particular path to specifics.

Hooray

0
source share

All Articles