调用此扩展程序时出现以下错误:
extension UIView {
/// Create image snapshot of view.
func snapshot(of rect: CGRect? = nil) -> UIImage {
return UIGraphicsImageRenderer(bounds: rect ?? bounds).image { _ in
drawHierarchy(in: bounds, afterScreenUpdates: true)
}
}
}
错误:
vImageConvert_AnyToAny - 失败宽度 = 0 高度 = 1 dst 组件 = 16 位浮点 dstLayout = ByteOrder16Little dstBytesPerRow = 0 src 组件 = 16 位整数 srcLayout = ByteOrder16Little srcBytesPerRow = 0
任何想法为什么会这样?想知道色彩空间问题是否......在模拟器上运行良好,在物理设备上中断。