3
votes

I'm using the method monospacedSystemFontOfSize:weight: of UIFont to get a system specific monospaced font, and according to SDK, it's available in iOS 12.0+:

https://developer.apple.com/documentation/uikit/uifont/3042484-monospacedsystemfont

however, I got a crash when running the app on iOS 12:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIFont monospacedSystemFontOfSize:weight:]: unrecognized selector sent to class 0x11a9547b0'

Did I miss something?

Thanks!

1
It looks like it's iOS 13+. Have same issue for iOS 12 - alokard

1 Answers

4
votes

Documentation is wrong, it's only available in iOS13+. In Xcode 11.4, it's an error during compile time.