Search code examples
iosmacossnapshotapple-m1silicon

UIView snapshot crashes in iOS app running natively on Apple Silicon


I am using default snapshotView(afterScreenUpdates: false) in my app and it crashes on Mac Mini with M1 chip (Thread 1: EXC_BAD_ACCESS (code=1, address=0x20)

Also, I got the same crash with drawViewHierarchyInRect and all of this graphics/UI methods.

Any ideas what's wrong and how to fix it?


Solution

  • We also had this crash, suspected it had something to do with using a Metal layer in our app. Couldn't figure out the exact cause, but the issue seems to be resolved in macOS Monterey.