---
title: "getPrivacyBehavior(for:withHandler:)"
framework: clockkit
role: symbol
role_heading: Instance Method
path: "clockkit/clkcomplicationdatasource/getprivacybehavior(for:withhandler:)"
---

# getPrivacyBehavior(for:withHandler:)

Returns the privacy behavior for the specified complication.

## Declaration

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

```swift
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:

## Discussion

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

- [CLKComplicationPrivacyBehavior](clockkit/clkcomplicationprivacybehavior.md)

## See Also

### Deprecated methods

- [CLKLaunchedTimelineEntryDateKey](clockkit/clklaunchedtimelineentrydatekey.md)
- [CLKLaunchedComplicationIdentifierKey](clockkit/clklaunchedcomplicationidentifierkey.md)
- [getComplicationDescriptors(handler:)](clockkit/clkcomplicationdatasource/getcomplicationdescriptors(handler:).md)
- [handleSharedComplicationDescriptors(_:)](clockkit/clkcomplicationdatasource/handlesharedcomplicationdescriptors(_:).md)
- [getLocalizableSampleTemplate(for:withHandler:)](clockkit/clkcomplicationdatasource/getlocalizablesampletemplate(for:withhandler:).md)
- [CLKComplicationPrivacyBehavior](clockkit/clkcomplicationprivacybehavior.md)
- [getAlwaysOnTemplate(for:withHandler:)](clockkit/clkcomplicationdatasource/getalwaysontemplate(for:withhandler:).md)
- [getTimelineEndDate(for:withHandler:)](clockkit/clkcomplicationdatasource/gettimelineenddate(for:withhandler:).md)
- [getCurrentTimelineEntry(for:withHandler:)](clockkit/clkcomplicationdatasource/getcurrenttimelineentry(for:withhandler:).md)
- [getTimelineEntries(for:after:limit:withHandler:)](clockkit/clkcomplicationdatasource/gettimelineentries(for:after:limit:withhandler:).md)
- [getTimelineAnimationBehavior(for:withHandler:)](clockkit/clkcomplicationdatasource/gettimelineanimationbehavior(for:withhandler:).md)
- [CLKComplicationTimelineAnimationBehavior](clockkit/clkcomplicationtimelineanimationbehavior.md)
- [getSupportedTimeTravelDirections(for:withHandler:)](clockkit/clkcomplicationdatasource/getsupportedtimetraveldirections(for:withhandler:).md)
- [CLKComplicationTimeTravelDirections](clockkit/clkcomplicationtimetraveldirections.md)
- [getTimelineStartDate(for:withHandler:)](clockkit/clkcomplicationdatasource/gettimelinestartdate(for:withhandler:).md)
