Video Feed Layouts
There are two concrete layout types
VideoFeedHorizontalLayout
and VideoFeedGridLayout
. A layout can be specified at time of instantiating a let feedVC = VideoFeedViewController(layout: VideoFeedGridLayout())
. Or the layout can be set later by setting the layout property of the video feed view controller; feedVC.layout = VideoFeedHorizontalLayout()
.The
VideoFeedHorizontalLayout
is a layout that has a single row and scrolls horizontally. The row will fill the available height.AVideoFeedHorizontalLayout
is best used by embedding in another view controller.

The
VideoFeedGridLayout
is a layout that provides a vertical scrolling feed that has both columns and rows. The width of the items in the grid are calculated based on the numberOfColumns
property in the VideoFeedGridLayout
.

A vertical layout can be achieved by setting
numberOfColumns
property in the VideoFeedGridLayout
as 1.

Note: Only changing a layout property does not change theVideoFeedViewController
layout. To update theVideoFeedViewController
layout you must set thelayout
property after making the layout changes.
Last modified 1yr ago