I need to crop an image to a rectangle with a height of 25 and a width the length of the screen.
I have the image ready and positioned in the center of the screen. I'd like to screenshot ONLY the rectangle.
I followed this answer, but it does not seem to be working for me for some reason.
UIGraphicsBeginImageContextWithOptions(CGSizeMake(self.view.frame.width,25), false, 0)
self.view.drawViewHierarchyInRect(CGRectMake(self.view.frame.width,25,view.bounds.size.width,view.bounds.size.height), afterScreenUpdates: true)
let image:UIImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
statusImage = image