<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "MetalKit"
    ],
    "preciseIdentifier" : "c:objc(pl)MTKViewDelegate"
  },
  "title" : "MTKViewDelegate"
}
-->

# MTKViewDelegate

Methods for responding to a MetalKit view’s drawing and resizing events.

```
protocol MTKViewDelegate : NSObjectProtocol
```

## Overview

You can set an object that implements the [`MTKViewDelegate`](/documentation/MetalKit/MTKViewDelegate) protocol as a [`MTKView`](/documentation/MetalKit/MTKView) object’s delegate. Use a delegate to provide a drawing method to a [`MTKView`](/documentation/MetalKit/MTKView) object and respond to rendering events without subclassing the [`MTKView`](/documentation/MetalKit/MTKView) class.

## Topics

### Changing the View’s Layout

[`mtkView(_:drawableSizeWillChange:)`](/documentation/MetalKit/MTKViewDelegate/mtkView(_:drawableSizeWillChange:))

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

### Drawing the View’s Contents

[`draw(in:)`](/documentation/MetalKit/MTKViewDelegate/draw(in:))

Draws the view’s contents.



---

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)