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.