Instance Method

dismissContentProposal(for:animated:completion:)

Dismisses the current content proposal.

Declaration

func dismissContentProposal(for action: AVContentProposalAction, animated: Bool, completion block: (() -> Void)? = nil)

Parameters

action

Indicates whether the user has accepted or rejected the content proposal, or has deferred the decision.

animated

true if the dismissal should be animated, false if the presentation should be dismissed immediately.

block

An optional block that will be called when the proposal has been hidden.

Discussion

This method should be called when the user is leaving the presentation. For AVContentProposalAction.accept, the proposed content will begin to play; for AVContentProposalAction.reject, the player view controller will be dismissed. For action AVContentProposalAction.defer, the video will resume playing, or if it has ended, will replay from the beginning.

See Also

Dismissing the Content View Controller

enum AVContentProposalAction

Constant values for the content proposal action.