Contents

mtkView(_:drawableSizeWillChange:)

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

Declaration

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