Is changing the color of the iOS control panel safe?

I correctly use the following method to change the color of the scoreboard icon,

[tabBarController.tabBar setSelectedImageTintColor:[UIColor redColor]]; 

but before using it, I read some reports of Apple app crashes due to this problem. I guess if the ios5 method should now be accepted. It's true? Thanks.

+1
source share
3 answers

It will not be rejected, but you will need to install the target deployment system for iOS 5, and users running iOS 4 will not be able to download and install your application.

To use this method only for iOS 5 and allow the application to run on iOS 4 (with blue tabs), follow these steps:

 if ([UITabBar instancesRespondToSelector:@selector(setSelectedImageTintColor:)]) { [tabBarController.tabBar setSelectedImageTintColor:[UIColor redColor]]; } 

This code can be safely run on iOS4.

Alternatively, see my answer to this question, which explains how to fully customize the colors of the tab icons in a way that works on any version of iOS: image of the tab element and selectedImage

+9
source

I have not tried it myself, but I looked at the link to the UITabBar class . The selectedImageTintColor property is documented. Thus, this means that you are allowed to use it. Typically, Apple rejects an application that uses undocumented (rather than public) APIs. Therefore, you can use it.

You can also see that the property is available in iOS 5 and later.

0
source

You can check out this post on how to determine the current version of iOS, and make the appropriate tab color settings for users running iOS 5 or lower. Hope this helps.

0
source

Source: https://habr.com/ru/post/907690/


All Articles