Title: TVOS about App layout (Like in iTunes and similar)
Tags: ios;swift;tvos
Question: I have played a lot with my app and I do not understand how to make layout like in for example iTunes (also many apps uses it).


How it is made? It is one big ```CollectionView```, but with special ```Flow``` or it is ```TableView``` with many ```CollectionView```?





Collection headers. In iTunes App if I select item (with adjustImageWhenFocused) under the header then the header will jump up and the item will not overlap the header. It is special magic or it is system behavior and I just do know how to use it?


Below is two screenshots about what I am trying to tell you and example with my app.





In iTunes there are movie preview page. With what type of ```View``` it is made? ```TableView```,```CollectionView``` or just ```ViewController``` with ```ScrollView```?




I have read many sources and looked up demo projects, but nowhere I have found answers for this questions.


Here is the accepted answer: 1) I think it would be a ```stackTemplate``` containing a couple ```collectionList```s.

2) AFAIK the headers "jump up" on their own, no need to prepare anything special.

3) ```productTemplate```?

For examples, see https://github.com/iBaa/PlexConnectApp, ```/TVMLTemplates/Default/Movie_OnDeck.xml``` (1) or ```Movie_PrePlay.xml``` (3).

Or check the gold source: https://developer.apple.com/library/tvos/documentation/LanguagesUtilities/Conceptual/ATV_Template_Guide/StackTemplate.html, plus other Templates.

Comment for this answer: how to add this feature using swift?
Comment for this answer: You want to say that I just need to use TVML instead of writing the app in Swift?
Comment for this answer: Yeah, well, it's one way to re-use all those Apple predefined views - sorry that I missed, that you are looking for a "native" Swift way...

Here is another answer: If you want to use native Swift way it can be achieved in following ways:


You can use table view and have collection view within each cell. I am using same approach to achieve this.
We have focus update delegate from there you can find the focused frame of image view. With the help of focused frame and label frame you can check if they are intersecting or not. Based on that you can move label up and down.
This is native TVML template, in order to achieve in swift you need to create view using tableview and collection view.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:03/22/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<ios><swift><tvos>', 'Title': 'TVOS about App layout (Like in iTunes and similar)', 'ViewCount': 367, 'id': 36165837, 'user_AboutMe': None, 'user_AccountId': 2349364.0, 'user_DisplayName': 'user2058653', 'user_Reputation': 678.0, 'user_Views': 58.0, 'user_id': 2058653.0}}