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...