UIFeedbackGenerator object creation crashes on iOS 10.0

466 Views Asked by At

Has anyone else encountered this? Specifically with an iPhone 6 running iOS 10.0 I'm getting consistent reports of the following crashing:

if #available(iOS 10.0, *) {
    UISelectionFeedbackGenerator()
}

Where it's not even being used, just created and it causes an EXC_BAD_ACCESS crash. The docs say it just fails silently if the device doesn't support it. Oddly enough if I change the check to iOS 10.0.1 it works fine.

Am I doing something wrong?

1

There are 1 best solutions below

0
On

I saw a few seemingly random crashes in production when calling this function as well. When reviewing some old logs, I found that this was only occurring on iOS 10.0.0. As users updated past that, I stopped seeing the crash. I imagine it was some sort of internal UIKit bug that was fixed in iOS 10.0.1.