---
title: "mtkView(_:drawableSizeWillChange:)"
framework: metalkit
role: symbol
role_heading: Instance Method
path: "metalkit/mtkviewdelegate/mtkview(_:drawablesizewillchange:)"
---

# mtkView(_:drawableSizeWillChange:)

Updates the view’s contents upon receiving a change in layout, resolution, or size.

## Declaration

```swift
@MainActor func mtkView(_ view: MTKView, drawableSizeWillChange size: CGSize)
```

## Parameters

- `view`: The view requesting that its contents be updated.
- `size`: The view’s new drawable size.

## Discussion

Discussion Use this method to recompute any view or projection matrices, or to regenerate any buffers to be compatible with the view’s new size.
