Using Metal to draw a view’s contents | Apple Developer Documentation

Create a MetalKit view and a render pass to draw the view’s contents.