Contents

getPrivacyBehavior(for:withHandler:)

Returns the privacy behavior for the specified complication.

Declaration

optional func getPrivacyBehavior(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationPrivacyBehavior) -> Void)
optional func privacyBehavior(for complication: CLKComplication) async -> CLKComplicationPrivacyBehavior

Parameters

  • complication:

    The complication tied to the request.

  • handler:

    The handler to execute with the privacy behavior. This block has no return value and takes the following parameter:

    behavior

    The privacy behavior to apply to the specified complication. You can specify different privacy behaviors for different complication families.

Discussion

ClockKit calls this method to determine how to display your complication data when the user’s Apple Watch is locked. If your complication contains any personal information for the user, pass the CLKComplicationPrivacyBehavior.hideOnLockScreen value to the handler. For data that’s already available publicly, you may pass the CLKComplicationPrivacyBehavior.showOnLockScreen value to the handler to allow that data to be displayed.

If you don’t implement this method, ClockKit uses the value CLKComplicationPrivacyBehavior.showOnLockScreen as the default.

Topics

Privacy Behaviors

See Also

Deprecated methods