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
}
在Iphone6-Plus中运行此函数将导致“drawViewHierarchyInRect”上的EXC_BAD_ACCESS。在Iphone6-Plus模拟器中它捕获空图像。 但它在Iphone5 Iphone6上很好......