I use UIGraphicsImageRenderer to draw a large image, but the Xcode logging Metal API Validation Enabled and [Metal] 5073 by 8663 iosurface is too large for GPU. The resulting image is a blank image with a very small size.
let format = UIGraphicsImageRendererFormat()
format.scale = 1            
renderer = UIGraphicsImageRenderer(size: borderSize, format: format)
let newImage = renderer.image { context in    
  image.draw(in: imageRect)    
  …
}
My purpose is to add a border with text to the image, is there a way to solve this problem? Or is there any other way of drawing large image?