Show only Time in status bar iOS - 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.

Related

Changing the height and design of the tab bar below an ios app

i am designing an app, ios based. i am doing this with the guidelines of apple. but i have a question about the tab bar below the app. Apps like spotify, facebook ,whatsapp and twitter are using a tab bar below the screen.
Is it possible in de 'code' to change the height of this? I am asking this because of the target audience. also the font-size.
Example
https://techcrunch.com/wp-content/uploads/2013/09/facebook-updated-screenshot-ios-7.png?w=730&crop=1
sorry if the question does not belong here in the community.
You can't change the height of an UITabBar or the font size of the bar button labels.
If you need this, you must either build your own TabBar or see if someone has already done it. (Search for UITabBar or UITabBarController replacement)

How To Avoid iOS Blue Location NavigationBar Messing Up My StatusBar?

iOS has a feature that (I'm using both iOS 10 and 11) when you use a location-based app, say Waze, and you put that app on the background, there will be a blue navigation bar with a blue status bar background saying that Waze is currently using your location. Then open up your own project and close the Waze, this will happen.
Any idea how to fix this one? I'm guessing some configuration in the AppDelegate. Something to setup upon making your project active. I've tried the same steps in my other project and I have no idea why does that other project handle it a little better. The other project has a readable status bar but different background color, still quite a mess but better than in this project in the photo.
This is how your app should work:
The status bar is transparent.
Your view controller's main view should underlap the status bar; it should be fullscreen.
Your views should use autolayout to respond to changes in the size of the top bars (they should be pinned to the top layout guide or, in iOS 11, the top of the safe area).
You are not doing that correctly, so your app does not behave correctly when the status bar size changes due to the location manager bar. You probably have the same problem with phone calls coming in. You can easily test in the Simulator by choosing Toggle In-Call Status Bar.

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

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.

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

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.

Resources