is it possible to control status bar position under iOS 8? - ios

I want to know if it possible to control the position of the status bar with iOS 8 SDK?
I know i can use supportedInterfaceOrientations method, but now with the iOS 8 SDK if i change the orientation of the rootViewController all child viewController will take the same orientation because of viewWillTransitionToSize method.
Somebody can help me ?
Thanks in advance

According to the apple docs here:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/Bars.html
Don’t create a custom status bar. Users depend on the consistency of the system-provided status bar. Although you might hide the status bar in your app, it’s not appropriate to create custom UI that takes its place
This means that no, you cannot and should not change the default position of the status bar or put anything under it or around it that would obscure it. You can hide it or change its default appearance if you like, that is explained in the docs.

Related

Swift: how to switch statusbar orientation in IOS 9+?

I'm building a game that is based on gestures. IOS' native gestures that bring in notification center and control center on side swipe are super annoying as they interfere with gameplay.
Having searched extensively for a solution, I have come to belive that there is no way to disable/block control center or notification center on app level.
One possible solution that could help that I found was to turn the status bar orientation. My app runs in landscape orientation. If I could switch notification/control centers from top and bottom swipe to left and right swipes, I think that could almoast solve my problem.
However this seems to be possible but depreceted since IOS 9: https://developer.apple.com/documentation/uikit/uiapplication/1622939-setstatusbarorientation?language=objc
Apple suggests to use UITraitCollection instead. However I can't figure out how to change the orientation of the status bar using this. Sample code would be greatly appreciated!
From the same documentation it states:
you should not arbitrarily set status-bar orientation using this
method
This is even more true now because if you do try to use this method you get this warning (and it didn't actually work):
'setStatusBarOrientation(_:animated:)' was deprecated in iOS 9.0:
Explicit setting of the status bar orientation is more limited in iOS
6.0 and later
This is not something you should be trying to do with your app. Either hide the status bar or leave it at the top.

UIKit - Place own statusbar above UINavigationController

My app is in landscape and uses a UINavigationController as its RootViewController. My goal with it is:
Disable the normal iOS StatusBar ( I know how to do that and already did it )
Have a semi-transparent StatusBar (a view) above the UINavigationBar, so that I can show custom information on it
Parts of the content of my main view must be visible underneath my custom StatusBar (exactly like it works with the normal UIStatusBar, just that I don't want the clock and battery and want to show my own information on it)
How can I best achieve this?
A quick search on GitHub gave me multiple libraries that offer the exact functionality you are looking for.
MTStatusBarOverlay
KGStatusBar
CWStatusBarNotification
FDStatusBarNotifierView
BWStatusBarOverlay
WTStatusBar
TWStatus
Try them out, test them and see which one is best for you.
If none of them are good enough, you should get an idea on how to achieve this functionality using the source code those libraries provide.
iOS 7 Human Interface Design, page 143 says:
Don’t create a custom status bar. Users depend on the consistency of
the system-provided status bar. Although you might hide the status bar
in your app, it’s not appropriate to create custom UI that takes its
place.
iOS Human Interface Guidelines

Show only Time in status bar iOS

So i only want to display the time for the status bar. Is there a way to format the status bar to only show the time, or am I going to have to just implement a time display object and hide the status bar? Any help would be great!! Thanks
There is no public API to modify the status bar. You can implement a status bar of your own, but note that partially implementing a status bar is against Apple's AppStore rules and potentially unsafe (more specifically, replacing the functionality of a status bar which the users are accustomed to). For example, see here:
We found your app uses system-provided items in a non-standard manner,
which is not in compliance with the App Store Review Guidelines.
Specifically, we found your app animates the status bar. Please see
the attached screenshot for reference to the issue [screen shot shows
the custom status bar saying "Up To Date"].
Learn more about system-provided items in the iOS Human Interface
Guidelines, sections: "System-Provided Buttons and Icons" and "iOS UI
Element Usage Guidelines."
If you still want to implement you can either hide the system status bar and a new view to each of your views, or create a new UIWindow with a windowLevel of UIWindowLevelStatusBar + 1 and a frame of [UIApplication sharedApplication].statusBarFrame and a label, will give you exactly what you need.

Notification bar in iPhone apps

I would like to create a notice bar, like the active-phone-call notice bar, whenever my user losses connection to my server.
Is there an easy way to do this? Can't find it in the API, but there must be some supported way - or should I program it manually?
Example: The difference being I want it to be active while in my app and I want to define the text myself.
There is no direct API available for doing this, but you can change the status bar color like this
self.window.backgroundColor = [UIColor colorWithRed:0.78f green:0.13f blue:0.11f alpha:1];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];
and add another view below with your custom text.
Or, if you just want so put some information in the status bar with a custom color, take a look at KGStatusBar or MTStatusBarOverlay.
You can set a window at the statusbar level and actually replace the phone's status bar with your own, if this is what you are asking. The way this can be implemented is found here
However keep in mind that your app may be rejected by Apple in that case.
A lot of apps, are using this for showing for a brief moment some information on the status bar position, then they show the status bar again. The Groupon App was actually doing this and was displaying a UIPageControl when you swiped through their different UITableViews to show you how many UITableViews are available.
Here's a decent library I came across the other day called "KGStatusBar, A minimal status bar for iOS." https://github.com/kevingibbon/KGStatusBar. I haven't tried it yet but glancing at the source it seems solid.

Is this the right way to make an iPad app full screen?

I want to disable the status bar in iOS to make my app full-screen. I managed it but I'm not sure I did it correctly.
Here's what I did:
In IB, set the Simulated Metric for Status Bar to None
Added an entry in the Info.plist UIStatusBarHidden = YES
Moved my views around in IB so they fill the screen.
I'm not using OpenGL or anything like that, it's just a straightforward Cocoa Touch app which, like many others of a similar type, benefits from having access to every pixel on the screen.
To my shame I got the technique from one of those omnipresent 'tutorials' that litter the web like the dust bunnies under my bed. It was dated 2009. Is there a more modern, approved technique I should be using instead?
If it helps I'm targeting iOS 5 only.
The statusBarHidden property of the shared UIApplication object controls whether the status bar is visible. The UIStatusBarHidden entry in the app's Info.plist sets the value of that statusBarHidden property when the application is launched. You can change the property's value to hide or show the status bar while your app is running.
These are the current methods for controlling the status bar's visibility as of iOS 5.0.1.

Resources