<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalKit",
  "identifier" : "/documentation/MetalKit/MTKViewDelegate/mtkView(_:drawableSizeWillChange:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MetalKit"
    ],
    "preciseIdentifier" : "c:objc(pl)MTKViewDelegate(im)mtkView:drawableSizeWillChange:"
  },
  "title" : "mtkView(_:drawableSizeWillChange:)"
}
-->

# mtkView(_:drawableSizeWillChange:)

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

```
@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

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)