Swift SFSymbol unexpectedly found nil for UIImage

Viewed 282

I have a bug that I am not understanding.

All devices I have tested are not having this issue. However, on ipad mini 4 iOS 13.4 I am receiving the error: Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value

let image = UIImage(systemName: "chevron.forward")?

I am programmatically assigning the value on viewDidLoad(). All devices I have tested do not have this issue but mini 4.

I thought SF symbols work for iOS 13+ but I can seem to understand why the crash is happening on the iPad mini 4.

Apple states,

"SF Symbols are available in iOS 13 and later, macOS 11 and later, watchOS 6 and later, and tvOS 13 and later."

But does not share that only particular symbols can be accessed in different iOS versions. Reference

1 Answers

Apple has added new symbol at various times. The chevron.forward symbol was added in iOS 14, which is why it's crashing in iOS 13 for you.

Related