iOS change tabbar item color is safe? - objective-c

I am properly using following method to change tabbar icon color,
[tabBarController.tabBar setSelectedImageTintColor:[UIColor redColor]];
but before using it I read some posts about apple's app rejection due to this issue. I assume that if is an ios5 method must now be accepted. Is it true? Thanks.

It won't be rejected, but you'll have to set your deployment target to iOS 5 and people running iOS 4 won't be able to download and install your app.
To use this method only on iOS 5, and still allow the app to work on iOS 4 (with blue tabs) do this:
if ([UITabBar instancesRespondToSelector:#selector(setSelectedImageTintColor:)])
{
[tabBarController.tabBar setSelectedImageTintColor:[UIColor redColor]];
}
This code is safe to run on iOS4.
Alternatively, see my answer to this question that explains how to fully customise the tab icon colours in a way that works on any iOS version: tabbar item image and selectedImage

I didn't try it myself but I took a look at the UITabBar Class Reference. The property selectedImageTintColor is documented. So this means, you are allowed to use it. Normally Apple only rejects application that use undocumented (not public) APIs. So you are safe to use it.
You can see there too that the property is available in iOS 5 and later.

You can check this post on how to determine the current iOS version and do the appropriate tab bar item color setting for users running iOS 5 or lower. Hope this helps.

Related

How to deal with the ios Launch files

It has been a while since I created my last app and I missed the change with the launch file (since titanium 5.2.0).
I want my app to have a custom splashscreen (full screen image). In the past I used the various png files for the splashscreens Default.png, Default#2x.png etc.
I'm testing with the launch file and the custom Storyboard. At the moment it's not clear to me how I can achieve the behavior i want: A full screen image in the splash screen.
What is the best approach?
Thanks for the help.
Go to http://docs.appcelerator.com/platform/latest/#!/guide/Icons_and_Splash_Screens-section-29004897_IconsandSplashScreens-iOSgraphicassetrequirementsandoptions and take a look at the Purpose column. You'll see 9 splash screen sizes. You have to make each of them and put them in app/assets/iphone. Note that you have to name them exactly as told in the table.
This worked for me, Ti-5.4.0 tested on iPhone 7, iPad Air, iPhone 4S and iPhone 6S Plus.
Since version 5.2 storyboards were introduced. You can use them or you can disable it and use the "old" method to implement splashscreens.
To disable it, add this to tiapp: (of course, within the existing ios section in tiapp
<ios>
<enable-launch-screen-storyboard>false</enable-launch-screen-storyboard>
</ios>
To use it, look at the documentation how to implement it correctly.

How to display UIAlertView without buttons on iOS 8?

In an app I'm working on we have some legacy code that displays timed UIAlertViews at several points in the application. These are alert views that display for a certain amount of time (let's say 2 seconds) before they disappear.
These alert views don't have buttons, just a title and a message. Somehow these alert views worked just fine on iOS 5, 6 and 7, but on iOS 8 the message label isn't being displayed anymore.
Does anyone have a fix for this issue? I should note we're not interested in using UIAlertController, since that class is limited to iOS 8 and we need to support older versions as well.
So my question is as follows: is it possible on iOS 8 to display an UIAlertView with just a title and a message and NO buttons? (PLEASE NOTE: the message should be shown properly).
For anyone still struggling with this issue, I used the following approach:
I created an AlertController class that decided which version of an alert view to use. For iOS 7 and lower will default to the "build-in" UIAlertView. For iOS 8 I resorted to a custom alert view.
There are several custom alert views that could be used to create a modal dialog that displays for a few seconds. I based my custom alert view on the code from the iOS Custom Alert View project. Additionally I fixed the look and feel. Suffice to say, the default look and feel of this project doesn't closely match the iOS 7 / 8 look and feel, especially with regards to the buttons. The pop / hide animation is pretty well done though. Fixing the look and feel involved creating a custom dialog view class that uses -drawRect: to draw lines around buttons. The custom subview will also add it's own buttons.
An alternative project that might have a better look and feel out-of-the-box is SDCAlertView. If I would have found SDCAlertView before starting my work on fixing iOS Custom AlertView, I would probably have saved some time.
I should note I cannot share my code / changes. My employer would not like this at all.
You can try this code for your UIAlert:
let alert = UIAlertView()
alert.title = "Title"
alert.message = "Message"
alert.show()
It should display a UIAlert without a button.
Hope this can help you.

Add NSWindow in front of fullscreen app

I want to have a window in front of all the others apps.
I want this window appear on keyword shortcut like "Alfred" app.
I try a lot of solution but nothing work for having NSWindow in front of fullscreen app on main or second screen.
I tried the classic :
[self.window setLevel:NSMainMenuWindowLevel + 1];
[self.window setCollectionBehavior:NSWindowCollectionBehaviorStationary|NSWindowCollectionBehaviorCanJoinAllSpaces|NSWindowCollectionBehaviorFullScreenAuxiliary];
[self.window setHidesOnDeactivate:NO];
It's work except with Fullscreen app.
It's work with NSPanel with [self.videoWindow setStyleMask:NSBorderlessWindowMask];
but only on main screen.
Anyone have a solution ? Alfred developper around ?
Alfred is implemented as an Agent. Agents can display Windows on spaces of fullscreen Apps. You should also make your App an Agent.
This can be achieved by adding the Application is Agent flag to the info.plist file of your App and setting the value to YES.
I managed to disdplay auxiliary window on top of full screen app via the following:
self.collectionBehavior = NSWindowCollectionBehaviorMoveToActiveSpace | NSWindowCollectionBehaviorFullScreenAuxiliary;
do not call [NSApp activateblabla];
make application LSUIElement, and do not display the Dock icon via TransformProcessType
However, don't know yet how to display it correctly for app which has the Dock icon. From the other side I do not know which app can do it while having the Dock icon.
It may depend on exactly how the application in question achieves fullscreen, but you likely just need to use a higher window level than NSMainMenuWindowLevel + 1 such as CGShieldingWindowLevel()+1
You can download Quartz Debug from Apples developer downloads (required free developer account)
Quartz Debug can tell you the level of any window and all you need to do is set your window to be higher than the one you are having problems with (assuming the app in question isnt doing something odd to be fullscreen).

Implement iOS 7 like Download Button

I need to implement iOS 7 like download button to show progress (Same as it is in iOS 7 AppStore app downloads).
Anybody has any idea what is the way to go about it?
Is there any existing control to achieve this or it is something apple specific and anybody else needs to implement using custom CAShapeLayer etc?
You have to make your custom implementation.
If you need it, here it is a very similar one:
An iOS 7-inspired blue circular progress view
Check my library, it contains that button, and it is customizable https://github.com/PavelKatunin
I know that this is an old question, asking for iOS 7 App Store download button, but if anyone is looking for the download button of the latest App Store (since iOS 11) I can suggest you take a look at this library. It provides the download button with progress and transition animation.
Here is a demo.

Can we make Animated icons for iOS 7 now in Xcode?

When i saw new iOS 7.0 then i saw clock icon is on running state. So i am curious to know, that can we also make icons dynamically by Xcode?
i googled also about this but didn't found any question or hint on this.
No, we're not able to created animated Springboard icons. The following still applies to iOS7.
Changing Icon per Day
Dynamic icon iOS