---
title: ContentMode.fit
framework: swiftui
role: symbol
role_heading: Case
path: swiftui/contentmode/fit
---

# ContentMode.fit

An option that resizes the content so it’s all within the available space, both vertically and horizontally.

## Declaration

```swift
case fit
```

## Mentioned in

Fitting images into available space

## Discussion

Discussion This mode preserves the content’s aspect ratio. If the content doesn’t have the same aspect ratio as the available space, the content becomes the same size as the available space on one axis and leaves empty space on the other.

## See Also

### Getting content modes

- [ContentMode.fill](swiftui/contentmode/fill.md)
