---
title: "customDetentWithIdentifier:resolver:"
framework: uikit
role: symbol
role_heading: Type Method
path: "uikit/uisheetpresentationcontrollerdetent/customdetentwithidentifier:resolver:"
---

# customDetentWithIdentifier:resolver:

Creates a custom detent for a sheet by computing its value according to the properties of the provided context.

## Declaration

```occ
+ (instancetype) customDetentWithIdentifier:(UISheetPresentationControllerDetentIdentifier) identifier resolver:(CGFloat (^)(id<UISheetPresentationControllerDetentResolutionContext>context)) resolver;
```

## Parameters

- `identifier`: An identifier for the detent. Specify a unique identifier for each custom detent for a sheet. If you don’t specify an identifier, the system generates a random identifier.
- `resolver`: A block for resolving the detent value with an input of type doc://com.apple.uikit/documentation/UIKit/UISheetPresentationControllerDetentResolutionContext. The value you return from this block is a height within the safe area of the sheet. For example, return 200 for a detent with a height of 200 plus doc://com.apple.uikit/documentation/UIKit/UIView/safeAreaInsets.doc://com.apple.uikit/documentation/UIKit/UIEdgeInsets/bottom when the sheet is edge-attached, or 200 when the sheet is floating. Return doc://com.apple.uikit/documentation/UIKit/UISheetPresentationControllerDetentInactive to specify that the detent is inactive according to the provided context. If the block depends on any external inputs, call doc://com.apple.uikit/documentation/UIKit/UISheetPresentationController/invalidateDetents() on the sheet when the external inputs change. Don’t set any properties on doc://com.apple.uikit/documentation/UIKit/UISheetPresentationController during the execution of this block.

## See Also

### Creating a custom detent

- [resolvedValueInContext:](uikit/uisheetpresentationcontrollerdetent/resolvedvalueincontext:.md)
- [UISheetPresentationControllerDetentResolutionContext](uikit/uisheetpresentationcontrollerdetentresolutioncontext.md)
- [UISheetPresentationControllerDetentInactive](uikit/uisheetpresentationcontrollerdetentinactive.md)
