Protocol

MTKViewDelegate

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

Declaration

protocol MTKViewDelegate

Overview

An object that implements the MTKViewDelegate protocol can be set as a MTKView object’s delegate. A delegate allows your Metal application to provide a drawing method to a MTKView object and respond to rendering events without subclassing the MTKView class.

Topics

Changing the View’s Layout

func mtkView(MTKView, drawableSizeWillChange: CGSize)

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

Required.

Drawing the View’s Contents

func draw(in: MTKView)

Draws the view’s contents.

Required.

Relationships

Inherits From

See Also

View Management

class MTKView

A specialized view that creates, configures, and displays Metal objects.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software