2
class func imageWithView(view : UIView) -> UIImage {
    println(view.bounds.size)
    UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0)
    view.drawViewHierarchyInRect(view.bounds, afterScreenUpdates: true)
    let img = UIGraphicsGetImageFromCurrentImageContext()
    UIGraphicsEndImageContext()
    return img
}

this function run in Iphone6-Plus will cause EXC_BAD_ACCESS on “drawViewHierarchyInRect”. in Iphone6-Plus simulator it capture empty image. but its fine on Iphone5 Iphone6...

bytecode77
  • 14,163
  • 30
  • 110
  • 141
xuxu273
  • 21
  • 2

0 Answers0