Loads a consent form and immediately presents it from the provided viewController if
UMPConsentInformation.sharedInstance.consentStatus is UMPConsentStatusRequired. Calls
completionHandler after the user selects an option and the form is dismissed, or on the next run
loop if no form is presented. Must be called on the main queue. If viewController is nil, uses
the top view controller of the application’s main window.
Declaration
Swift
class func loadAndPresentIfRequired(from viewController: UIViewController?) async throws
Presents a privacy options form from the provided viewController if
UMPConsentInformation.sharedInstance.privacyOptionsRequirementStatus is
UMPPrivacyOptionsRequirementStatusRequired. Calls completionHandler with nil error after the
user selects an option and the form is dismissed, or on the next run loop with a non-nil error
if no form is presented. Must be called on the main queue.
This method should only be called in response to a user input to request a privacy options form
to be shown. The privacy options form is preloaded by the SDK automatically when a form becomes
available. If no form is preloaded, the SDK will invoke the completionHandler on the next run
loop, but will asynchronously retry to load one. If viewController is nil, uses the top view
controller of the application’s main window.
Declaration
Swift
class func presentPrivacyOptionsForm(from viewController: UIViewController?) async throws
Presents the full screen consent form over viewController. The form is dismissed and
completionHandler is called after the user selects an option.
UMPConsentInformation.sharedInstance.consentStatus is updated prior to completionHandler being
called. completionHandler is called on the main queue. If viewController is nil, uses the top
view controller of the application’s main window.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eUMPConsentForm\u003c/code\u003e class manages the display and functionality of consent forms for user privacy.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to load, present, and handle user interactions with both consent and privacy options forms.\u003c/p\u003e\n"],["\u003cp\u003eBefore presenting any form, the SDK checks the user's consent status and privacy options requirement status.\u003c/p\u003e\n"],["\u003cp\u003eConsent forms are loaded and presented using static methods, while an instance method handles presenting the loaded form.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use completion handlers to perform actions after form dismissal or status updates.\u003c/p\u003e\n"]]],["The `UMPConsentForm` class manages user consent forms. Key actions include: loading a consent form via `loadWithCompletionHandler:`; loading and presenting it if required, using `loadAndPresentIfRequiredFromViewController:completionHandler:`; presenting a privacy options form with `presentPrivacyOptionsFormFromViewController:completionHandler:`. The method `presentFromViewController:completionHandler:` allows for displaying the consent form over a specified view controller. All actions occur on the main queue and utilize completion handlers for asynchronous results.\n"],null,["UMPConsentForm \n\n\n @interface UMPConsentForm : NSObject\n\nA single use consent form object.\n- `\n ``\n ``\n `\n\n [+loadWithCompletionHandler:](#/c:objc(cs)UMPConsentForm(cm)loadWithCompletionHandler:)`\n ` \n Loads a consent form and calls completionHandler on completion. Must be called on the\n main queue. \n\n Declaration \n Swift \n\n class func load() async throws -\u003e ConsentForm\n\n Objective-C \n\n + (void)loadWithCompletionHandler:\n (nonnull ../Type-Definitions.html#/c:UMPConsentForm.h@T@UMPConsentFormLoadCompletionHandler)completionHandler;\n\n- `\n ``\n ``\n `\n\n [+loadAndPresentIfRequiredFromViewController:completionHandler:](#/c:objc(cs)UMPConsentForm(cm)loadAndPresentIfRequiredFromViewController:completionHandler:)`\n ` \n Loads a consent form and immediately presents it from the provided viewController if\n UMPConsentInformation.sharedInstance.consentStatus is UMPConsentStatusRequired. Calls\n completionHandler after the user selects an option and the form is dismissed, or on the next run\n loop if no form is presented. Must be called on the main queue. If viewController is nil, uses\n the top view controller of the application's main window. \n\n Declaration \n Swift \n\n class func loadAndPresentIfRequired(from viewController: UIViewController?) async throws\n\n Objective-C \n\n + (void)\n loadAndPresentIfRequiredFromViewController:\n (nullable UIViewController *)viewController\n completionHandler:\n (nullable\n ../Type-Definitions.html#/c:UMPConsentForm.h@T@UMPConsentFormPresentCompletionHandler)\n completionHandler;\n\n- `\n ``\n ``\n `\n\n [+presentPrivacyOptionsFormFromViewController:completionHandler:](#/c:objc(cs)UMPConsentForm(cm)presentPrivacyOptionsFormFromViewController:completionHandler:)`\n ` \n Presents a privacy options form from the provided viewController if\n UMPConsentInformation.sharedInstance.privacyOptionsRequirementStatus is\n UMPPrivacyOptionsRequirementStatusRequired. Calls completionHandler with nil error after the\n user selects an option and the form is dismissed, or on the next run loop with a non-nil error\n if no form is presented. Must be called on the main queue.\n\n This method should only be called in response to a user input to request a privacy options form\n to be shown. The privacy options form is preloaded by the SDK automatically when a form becomes\n available. If no form is preloaded, the SDK will invoke the completionHandler on the next run\n loop, but will asynchronously retry to load one. If viewController is nil, uses the top view\n controller of the application's main window. \n\n Declaration \n Swift \n\n class func presentPrivacyOptionsForm(from viewController: UIViewController?) async throws\n\n Objective-C \n\n + (void)\n presentPrivacyOptionsFormFromViewController:\n (nullable UIViewController *)viewController\n completionHandler:\n (nullable\n ../Type-Definitions.html#/c:UMPConsentForm.h@T@UMPConsentFormPresentCompletionHandler)\n completionHandler;\n\n- `\n ``\n ``\n `\n\n [-init](#/c:objc(cs)UMPConsentForm(im)init)`\n ` \n Unavailable \n Unavailable. Use +loadWithCompletionHandler: instead. \n\n Declaration \n Objective-C \n\n - (nonnull instancetype)init;\n\n- `\n ``\n ``\n `\n\n [-presentFromViewController:completionHandler:](#/c:objc(cs)UMPConsentForm(im)presentFromViewController:completionHandler:)`\n ` \n Presents the full screen consent form over viewController. The form is dismissed and\n completionHandler is called after the user selects an option.\n UMPConsentInformation.sharedInstance.consentStatus is updated prior to completionHandler being\n called. completionHandler is called on the main queue. If viewController is nil, uses the top\n view controller of the application's main window. \n\n Declaration \n Swift \n\n func present(from viewController: UIViewController?) async throws\n\n Objective-C \n\n - (void)presentFromViewController:(nullable UIViewController *)viewController\n completionHandler:\n (nullable ../Type-Definitions.html#/c:UMPConsentForm.h@T@UMPConsentFormPresentCompletionHandler)\n completionHandler;"]]