Xcode 13 crash - UIFont.fontDescriptor.addingAttributes

Hello,

I keep getting this error now using Xcode 13 as shown in the image.

This is new since Xcode 13. It doesn't seem to like "UIFontDescriptor.FeatureKey.featureIdentifier".

Anyone got any reasons for why this might be?

The code is:

let smallCapsDesc = finalFont.fontDescriptor.addingAttributes([

					UIFontDescriptor.AttributeName.featureSettings: [

						[

							UIFontDescriptor.FeatureKey.featureIdentifier: kLowerCaseType,

							UIFontDescriptor.FeatureKey.typeIdentifier: kLowerCaseSmallCapsSelector

						]

					]

				])
				finalFont = UIFont(descriptor: smallCapsDesc, size: accessibilityFontSize)

I figured out what the issue might be: There was a bug where

'UIFontDescriptor.FeatureKey.type: kLowerCaseType' 

did not work previously, but did work with

'UIFontDescriptor.FeatureKey.featureIdentifier: kLowerCaseType' 

And so I've changed it to what its supposed to be.

Hi,

'featureIdentifier' was deprecated in iOS 15.0: renamed to 'type'

Are you able to try:

UIFontDescriptor.FeatureKey.type: kLowerCaseType,

it is correct that you should be using UIFontDescriptor.FeatureKey.type and UIFontDescriptor.FeatureKey.selector respectively now with the latest SDK.

However, it should not crash with the deprecated names. Can you please file a feedback with a test project to reproduce the crash?

Xcode 13 crash - UIFont.fontDescriptor.addingAttributes
 
 
Q