Rightpoint / BonMot

Beautiful, easy attributed strings in Swift
MIT License
3.54k stars 196 forks source link

Crash in UISegmentedControl extension #397

Closed rzulkoski closed 3 years ago

rzulkoski commented 3 years ago

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.