I Need to take a screenshot of a part of the screen.
This is the code to take a screenshot of the full screen:
UIGraphicsBeginImageContext(view.frame.size)
view.layer.renderInContext(UIGraphicsGetCurrentContext())
let imageRef = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
But how do I take a screenshot from just a part of the screen?
Thank you