[UINavigationBar setLargeTitleTextAttributes:] unrecognized selector sent to instance

Getting a weird crash in Crashlytics on while setting the `largeTitleTextAttributes` property of the `UINavigationBar`.


Crashlog


Fatal Exception: NSInvalidArgumentException

-[UINavigationBar setLargeTitleTextAttributes:]: unrecognized selector sent to instance 0x157736e0


But this code is already guarded with #available


if #available(iOS 11.0, *) {
    navigationController?.navigationBar.largeTitleTextAttributes = [
        .foregroundColor: Constants.Color.Home.title
    ]
}


As per crashlytics carsh is happning on IOS 10, IOS 11 and IOS12


Any idea?

Doc states that you can set

You can specify the font, text color, text shadow color, and text shadow offset for the title in the text attributes dictionary, using the text attribute keys described in

NSAttributedString.Key
.


Does not mention foregroundColor.

Could you try with a different text attribute, or try Text background color (

CGColorRef
).

static let accessibilityBackgroundColor: NSAttributedString.Key


Could you show how you defined Constants.Color.Home.title

[UINavigationBar setLargeTitleTextAttributes:] unrecognized selector sent to instance
 
 
Q