新API UIGraphicsImageRenderer
bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.' *** First throw call stack: (0x1964fd08c 0x1937ff2e4 0x1958ce2fc 0x198cfa5c8 0x101dd864c 0x101dd7eb4 0x197f992c8 0x197ff0268 0x197f6f0a0 0x197fb2364 0x198cf2848 0x198cefe44 0x198cefcb8 0x198cef908 0x198cf087c 0x1964d0088 0x1964d001c 0x1964cdb08 0x1964ccd04 0x1964cc5b8 0x1e1f621c4 0x1990222c0 0x1990d0ddc 0x100520a5c 0x1bbca0d34) libc++abi: terminating due to uncaught exception of type NSException
这个UIGraphicsBeginImageContextWithOptions 已经被弃用了 UIGraphicsBeginImageContextWithOptions fail 的
Printing description of exception->exception: UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={365, 0}, scale=3.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.
判断一下高度或者宽度为0的时候,直接拦截掉