apptentive / apptentive-ios

Apptentive Legacy SDK for iOS. See https://github.com/apptentive/apptentive-kit-ios for Version 6.
http://www.apptentive.com/
BSD 3-Clause "New" or "Revised" License
146 stars 103 forks source link

tintColor for alerts cannot be overridden with ATConnect setTintColor: method #156

Closed jeremyprovost closed 9 years ago

jeremyprovost commented 9 years ago

Our application's tint color looks pretty bad with the alerts that prompt the user if they like the app or not (and whether to rate, remind, or no thanks). We tried overriding the tint color using the following:

[[ATConnect sharedConnection] setTintColor:[UIColor orangeColor]];

This does not seem to have any effect on the alerts that are displayed.

frankus commented 9 years ago

Thanks for reporting this. We have a fix in the pipeline for iOS 8 and 9 (using UIAlertController), but for iOS 7 unfortunately there is no public API for the button colors in UIAlertView and no really good workarounds.

In the meantime you can add the following code to override it for iOS 8 and 9 (e.g. in -application:didFinishLaunchingWithOptions:):

    [[UIView appearanceWhenContainedIn:[UIAlertController class], nil] setTintColor:[UIColor orangeColor]];
jeremyprovost commented 9 years ago

This fixes the main issue but breaks other uses of tintColor. Filed a radar:

https://openradar.appspot.com/radar?id=6066291735527424

frankus commented 9 years ago

This does appear to be a regression in iOS 9. The UIAlertController will always pick up the tintColor of the application's window.

frankus commented 9 years ago

Please take a look at our latest release as well as the updated customization guide.

Let me know if you're still running into problems for which there is a published API that fixes them. There are a few known issues (such as alert tint colors on iOS 7) for which there isn't a published API to fix them.