---
title: sizeToFitHeight()
framework: watchkit
role: symbol
role_heading: Instance Method
path: watchkit/wkinterfaceobject/sizetofitheight()
---

# sizeToFitHeight()

Sets the height of the object so that it fills the available vertical space.

## Declaration

```swift
func sizeToFitHeight()
```

## Discussion

Discussion This method is equivalent of using the Size to Fit Content option in Interface Builder. It sizes the object so that its height matches the height of its content. For example, calling this method on a label sets the height of the label to the height of its text. The height of an object never exceeds the height of its container. Changes to the height of an object are animatable.

## See Also

### Changing an Object’s Size

- [setWidth(_:)](watchkit/wkinterfaceobject/setwidth(_:).md)
- [setHeight(_:)](watchkit/wkinterfaceobject/setheight(_:).md)
- [setRelativeWidth(_:withAdjustment:)](watchkit/wkinterfaceobject/setrelativewidth(_:withadjustment:).md)
- [setRelativeHeight(_:withAdjustment:)](watchkit/wkinterfaceobject/setrelativeheight(_:withadjustment:).md)
- [sizeToFitWidth()](watchkit/wkinterfaceobject/sizetofitwidth().md)
