Screenshot Only Part of Screen - Swift
问题 I'm using this Swift code to take a screenshot of my app: UIGraphicsBeginImageContextWithOptions(UIScreen.mainScreen().bounds.size, false, 0); self.view.drawViewHierarchyInRect(view.bounds, afterScreenUpdates: true) var image:UIImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); How would I go about taking a screenshot of only part of the screen, and not all of it, as I do here? 回答1: For example if you want to take the screen shot of the UIView rectangle at