iOS: Pulsing red double-height status bar - objective-c

I am developing a recording app, and I'd like to show a pulsing red double-height status bar on top of my app while the app is recording, and while the user is still in the app - just like Voice Memos. How do I do that?
I can get it so that the double-height red status bar appears when I am outside the app, but not while inside the app. Any hints? Is it actually possible at all?

to answer the last question first: it is possible, though i don't know whether the mechanism for causing to happen in other apps can be applied to your own.
to answer your next to questions "how do i do that? any hints?": one hint would be to simply hide the [UIApplication sharedApplication] statusBar inside of your app conditionally based up whether you are in record mode or not, and create your own pulsing status bar to simulate the one that is being presented in other apps. i hide the status bar conditionally in one of my apps, and you can then present whatever you want in the status bar area.

Related

Native mail composer has normal status bar in iPhone but mostly blank in iPad

I'm using a UIDocumentInteractionController in my universal app. On an iPhone, when a user is presented with the interaction controller and they select the "Mail" option, a native Mail composer window is presented that still shows the full status bar (carrier, the time and the battery life indicator). When the same code executes on the iPad version, the native Mail composer window slides up and then right when it reaches the top, the status bar goes completely black except for the green bar that is normally inside the battery.
Is there anything I can do to control the appearance of the status bar when the native mail composer window opens?
Here you can change your status bar style in you App info, Hope it will help for you.

How to make the status bar translucent in iOS 7?

In my app, I have some webviews. A transparent status bar doesn't look good for full screen webview. I want to make the status bar TRANSLUCENT, just like the game center.
I notice that the status bar would be drawn translucent if there is a navigation bar under it. But I want a translucent status bar BY ITSELF.
Is there any way to do this?
If you look at the Human Interface Guidelines section about the Status Bar it recommends (emphasis mine on the section most related to your question):
Prevent scrolling content from showing through the status bar. As
users scroll, you don’t want them to see a confusing mix of app
content and status bar items in the status bar area. To give users the
impression of spaciousness while still ensuring maximum readability,
make sure the status bar has a background that obscures the content
behind it. Here are a few ways to keep scrolling content from showing
through the status bar:
Use a navigation controller to display content. A navigation controller automatically displays a status bar background and it ensures that its content views don’t appear behind the status bar. (To learn more about navigation controllers, see “Navigation
Controllers”.)
Create a nondistracting custom image—such as a gradient—and display it behind the status bar. To ensure that the image stays behind the status bar, you could use a view controller to keep the image above a scrolling view or you could use a scrolling view to keep it pinned to the top.
Position content to avoid the status bar area (that is, the area defined by the app’s statusBarFrame property). If you do this, you should use the window’s background color to provide a solid color behind the status bar.
As the status bar is totally transparent and any content can go on top of it, I just create an empty UIToolbar that is 20px height which just looks like a perfect translucent background for the status bar.
This is not an ultimate solution, but it really helps and it is very easy to implement when you don't need a real tool bar.
Thanks to Apple that they do not provide an option to set the status bar from transparent to translucent.
In Xcode 6, create top, bottom, left, right constrains and set the
- constants to 0
- priorities to 749.
- Don't forget to UNCHECK the "Constrain to margins" check box.
How to create constrains?
At the bottom right of your storyboard window, there's four buttons. The second from your left has the constrains. Please google about constrains in Xcode 6 since it's a kinda new feature.
Hope this help,

Red Recording Bar in-app [duplicate]

I am developing a recording app, and I'd like to show a pulsing red double-height status bar on top of my app while the app is recording, and while the user is still in the app - just like Voice Memos. How do I do that?
I can get it so that the double-height red status bar appears when I am outside the app, but not while inside the app. Any hints? Is it actually possible at all?
to answer the last question first: it is possible, though i don't know whether the mechanism for causing to happen in other apps can be applied to your own.
to answer your next to questions "how do i do that? any hints?": one hint would be to simply hide the [UIApplication sharedApplication] statusBar inside of your app conditionally based up whether you are in record mode or not, and create your own pulsing status bar to simulate the one that is being presented in other apps. i hide the status bar conditionally in one of my apps, and you can then present whatever you want in the status bar area.

Customizing iPhone app taskbar

I thought that it was not allowed to customize the taskbar on the iPhone. However, I noticed this app called iHandy Tip Calculator which replaces the battery icon with a fast switch icon, that pops up a view as shown. How is this allowed, and if so how can I be doing something different?
If you run the app on an iPad, you'll see, how they do it: they are overlaying the normal status bar. Also note, that the screenshots in the app store don't show this feature. I assume, they were fearing to get rejected and disabled the overlay for the screenshots.
Apps from this developer iHandy incorporate this into the status bar, but I've never seen another company do this. I am surprised that the status bar is able to be modified in this way in any event.
My question on apple.stackexchange is posted over here:
https://apple.stackexchange.com/questions/71969/what-is-the-meaning-of-this-status-bar-icon
It is possible to create your own statusbar and "simulate" the network status and battery life etc in a 'full-screen' app. But apple doesn't allow it, but this might be one that 'slipped through' just like Gaz_Edge said.
You are correct. You are not suppose to be able to modify the 'springboard'. Apple normally refuse apps that do anything that modifies it. Maybe this one slipped through the net?
I just downloaded the latest version of iHandy Level (version 1.62.0) on an iPhone 5 running iOS 6 but don't see the icon (it's within the app rather than in the status bar). (And the status bar is hidden.)
I was curious to see if they actually hid the status bar and created their own custom status bar. If that was the case, you'd be able to tell because when you swipe down from the top for notification center, it would first show a little tab and then you'd have to swipe again to pull down the menu.
Guessing maybe they removed this functionality at Apple's request.
If anyone still has a version that shows it, please let us know if it shows the tab when you swipe for notification center. If not, they likely found some private api to allow them to replace the battery icon (which would be interesting).

How can you disable the iOS Notification Center within your App?

If you have a full screen iOS app and you want to prevent the notification center from being pulled down, can you and how?
Also can you block notification alerts or banners from displaying while your app is loading? (I think this is a no way for sure but wanted to ask just in case.)
It has been my experience that fullscreen apps (statusBarHidden = YES) have a slightly different notification center behavior by default: Swiping down over the area previously occupied by the status bar will only show a little tab. Only swiping the tab will then show the notification center. This has been enough to prevent accidental activation for me so far.
Currently, there is no public API for manipulating the behavior of the notification center. I am of the opinion that it's not likely that an app will ever be able to block a notification's appearance, and only slightly less unlikely that an app would be able to prevent the notification center from appearing. iOS is all about a consistent user experience experience at the price of developer freedom. I could see being frustrated by this kind of functionality if I were an unexpecting user.
All that said, there is always the dark-side of undocumented APIs. I would not be surprised if you could pull off some cleverness using those on a jailbroken device, but that's not my cup-o'-tea.
I just now figured this out. I am developing a game that runs in landscape and whenever I touched the left side, the notification center tab would appear. To fix this, you want to add the following:
setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft
I added this right after I setStatusBarHidden and I no longer have the problem of the notification tab.
Hope that helps.
An API was introduced in iOS 11, alongside a change in behavior to how Notification Center (and Control Center) is presented, to allow you to specify the desired behavior.
UIViewController.preferredScreenEdgesDeferringSystemGestures
In iOS 11+, Notification Center will always pull down when swiping from the very top of the screen, even if the status bar is hidden. preferredScreenEdgesDeferringSystemGestures allows you to specify that swiping a screen edge should not trigger the standard system UI, and instead it will provide a pull-out tab that the user must swipe again to bring out the system UI.
This is intended to be used for games where users swipe frequently, where it would be undesired to bring in system UI instead of control the game. For an immersive app like that, you can return .all to specify you don't want any system UI to appear the first time you swipe any edges of the screen, and it should instead prefer your app's own gestures.
Note that this will disable the ability to swipe once from the bottom to close an app on iPhones and iPads that don't have home buttons - the user will have to swipe twice to close the app.
There is still no way to completely disable Notification Center from within your app, nor prevent notifications from appearing while your app is in the foreground.
I built a very simple code snippet to address this issue programatically. I have a timer set-up in my app delegate that runs every .2 seconds each time it runs it keeps moving the status bar orientation so it doesn't impact the game play. I haven't experienced the annoying notification center in my app since! The only issue is the volume control rotates constantly and might be annoying but it's less annoying than notification center
int tick=0;
-(void)toggleNC
{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
tick++;
if (tick==1)
{
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft];
}
if (tick==2){
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
}
if (tick==3){
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];
}
if (tick==4){
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortraitUpsideDown];
tick=0;
}
}