---
title: "scaledValue(for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uifontmetrics/scaledvalue(for:)"
---

# scaledValue(for:)

Scales an arbitrary layout value based on the current Dynamic Type settings.

## Declaration

```swift
func scaledValue(for value: CGFloat) -> CGFloat
```

## Parameters

- `value`: The height value that you want to scale. Specify the height of the object that contains the text (at the standard Dynamic Type size) that you want to display.

## Return Value

Return Value A layout height that is scaled appropriately to accommodate the text that you want to display.

## Discussion

Discussion Use this method to scale the height of visual elements containing text. For example, if you define a button with text that can scale based on Dynamic Type, you would use this method to obtain an appropriately scaled height for your button’s background content.

## See Also

### Scaling Layout Values

- [scaledValue(for:compatibleWith:)](uikit/uifontmetrics/scaledvalue(for:compatiblewith:).md)
