Video Feed View Configurations(iOS)

There are many view customizations that are exposed and can be accessed by the viewConfiguration of a VideoFeedViewController. All view configurations are value types which means changing the properties will not update the view state. To update the view state, simply set the viewConfiguration with the updated view configuration.

let feedVC = VideoFeedViewController()

var config = VideoFeedContentConfiguration()

// Sets the feed  background to white
config.backgroundColor = .white

// Sets the corner radius to 4
config.itemView.cornerRadius = 4
// Sets the title layout insets to 0
config.itemView.titleLayoutConfiguration.insets = .zero
// Sets the title position to stacked
config.itemView.titleLayoutConfiguration.titlePosition = .stacked
// Sets the title to System 18
config.itemView.title.font = .systemFont(ofSize: 18)
// Sets the title number of lines to 1
config.itemView.title.numberOfLines = 1
// Sets the title color to black
config.itemView.title.textColor = .black
// Sets the title is hidden to false
config.itemView.title.isHidden = false
// Specifies if the sposored label should be shown on thumbnails
config.itemView.sponsored.isHidden = false
// Specifies if autoplay is enabled on thumbnails. 
config.itemView.autoplay.isEnabled = true

// Must set the viewConfiguration property to apply the changes
feedVC.viewConfiguration = config

Last updated