There is a typo inside of the method bon_titleTextAttributes(for:). When iterating over the existing titleTextAttributes it is assigning the attribute key/value pair as the new value rather than the value itself. This causes an unrecognized selector exception to be thrown and crashes the app.
To reproduce this crash you need to set some custom title text attributes on a segmented control and then either call segmentedControl.adaptText(forTraitCollection:) or turn on the adaptive content size monitor and change the content size in Settings > Accessibility > Larger Text.
There is a typo inside of the method
bon_titleTextAttributes(for:)
. When iterating over the existingtitleTextAttributes
it is assigning the attribute key/value pair as the new value rather than the value itself. This causes an unrecognized selector exception to be thrown and crashes the app.To reproduce this crash you need to set some custom title text attributes on a segmented control and then either call
segmentedControl.adaptText(forTraitCollection:)
or turn on the adaptive content size monitor and change the content size in Settings > Accessibility > Larger Text.