Instance Method

presentProfilePreferencePanel(currentSettings:availableProfiles:completion:)

Presents a user-to-profile configuration panel, which lets the user specify their preferred profile.

Declaration

func presentProfilePreferencePanel(currentSettings: [TVUserIdentifier : TVAppProfileDescriptor], availableProfiles: [TVAppProfileDescriptor], completion: @escaping ([TVUserIdentifier : TVAppProfileDescriptor]) -> Void)

Parameters

existingSettings

A dictionary that maps each Apple TV user to their preferred app profile object in your app. Each key is a string representing a system user that you previously obtained from the currentUserIdentifier property. The value is a TVAppProfileDescriptor object that you use to represent one of your app-specific profiles. The method uses this information to identify the preferred profile for each user.

availableProfiles

The complete list of app-specific profiles available in your app. The configuration panel displays this set of profiles to the user.

completion

The completion handler to call when the user dismisses the configuration panel. This handler has no return value and takes the following parameter:

newSettings

A dictionary containing an updated map from system user to app profile. The information is similar to what you provide in the existingSettings parameter, but reflects the changes made by the user.

Discussion

Calling this method displays a panel that lets the user configure which app-specific profile to associate with each Apple TV user account. The panel gives the user the option to select from any of the profiles in the availableProfiles parameter. It also uses the information in the existingSettings parameter to configure the initial mapping between users and profiles. After configuring the user accounts and dismissing the panel, the system calls your completion handler to deliver the updated mapping between user accounts and profiles.

See Also

Presenting Account-Related Dialogs

func shouldStorePreferenceForCurrentUser(to: TVAppProfileDescriptor, completion: (Bool) -> Void)

Prompts the user to save the specified profile as the preferred profile for the current user.