How Can I Get touch events in an iPad App's hidden status bar's area? - objective-c

I read about this problem for the iPhone on the post here.
The post says it's only a simulator problem. Right now I've got the same problem on my iPad app, on the device itself. The app has a status bar - but after hiding it in app i can't click/touch in that area (using iOS version 4.2).
Thanks in advance.

If you're desperate enough, you could have your own window on top of the (invisible) status bar and process events in there. Set its windowLevel high enough and you're good to go. However, that might not be a good solution for you, because there's no way to forward touches from one window to another. You might end up having to do a lot of touch handling yourself.

Related

NSStatusItem app development

I'm beginning some OS X development, I am reasonably accomplished with objective C and UIKIT.
There doesn't seem to be as much online about moving from iOS development to OS X as I thought there would be!
Anyway, I found a decent tutorial over a Ray Wenderlich, that basically explained the differences, (multiple NSWindows, then add to them NSViewControllers etc)
What I would like to do is make a little app that shows info in the status bar (beside the Wifi icon etc)
Basically all it does is have an NSStatusitem that has it's title set with info I want shown (e.g. current song title)
I've got one going and it's working ok so to my question:
I've got Application is agent (UIElement) (so I cannot see a dock icon or menubar)
The code for my little app all resides in the app delegate, now from iOS dev i'm sure this is not the right place for this code, but since the app is a just a status bar item, that has it's title updated I don't think I need a UIViewController etc....
Where should my apps logic go?
Anything online to transition from iOS to OS X?
As you dont have much work with NSWindows and NSViews, you surely dont need NSWindowController or NSViewController.
And I think for this kind of app even your AppDelegate class is enough and best place to put all your logic.
If you have some models then you can break your code upto that, and use it in the AppDelegate itself.
Transition from iOS to OSX.
If you are good in Objective-C then you dont have to worry about few more Cocoa-Controls especially GUI levels, you have full support of Documentation.
Switching between iOS to OSX, vice-versa is not to difficult, but yes if you end up with system level then you need to interact with OSX too.
As stated earlier, if you know Objective-C well, then you should not face major problems. However, there are some differences. I found these following documents helpful:
About Developing for Mac
Migrating from Cocoa Touch

Showing ProgressBar over Desktop (Transparent Window) - Cocoa

Well, it might be hard to describe, but what I want this:
When the application fires up, I want it to load a couple of components and I want to show a progress bar loading upto 100% Complete. But for Interface sake, I just want the progress bar on the desktop. I don't want the Window controls or background. My customized progress bar should appear on the desktop loading upto 100%, followed by showing of window and thereby, the entire app.
Just to mention, I want this in a Mac App being developed in Xcode.
I strongly suggest you think about the visual effect you're considering and the assumptions you're making. I would argue this to be "bad design":
Users can put anything as a Desktop Picture. If my background happens to be blue... and your custom progress bar is blue.. then I won't see the progress bar and will be left wondering why your application isn't responding. "Screw this app, it hangs when I launch it. Delete!"
Chances are that users have more than one application running. Your "floating progress bar" would be lost in a sea of other application windows. (Why is iTunes loading something? Oh wait!! It's this other windowless thing... "Not intuitive! Not cool")
This is not very Mac-like. Don't forget there are rules for each platform as to how to be a good citizen. Metro apps need to adhere to a specific Interface paradigm. Likewise, there's a thing to be said for "Mac-like" and I would argue this behaviour isn't (a floating progress bar).
I would strongly suggest you keep your progress bar within a properly named modal window. Applications go in-and-out of being front-most... so it's important to know what that progress bar relates too.
If you've considered all these, the following question should help you get started :
How to make an NSView transparent and show what's under the NSWindow?
You are probably talking of a borderless NSWindow (NSBorderlessWindowMask), with an opaque background view whose alpha is set to zero and an NSProgressIndicator subview to show the progress. You also probably want to use the -[NSWindow center] method to nicely center your window.
However, I doubt that you want that kind of UI. A progress bar is probably not visible on top of all desktops, and thus aesthetically worthless.
I think a rounded, half-transparant black window will be more suited in your case. Take a look at Matt Gemmell's source code.

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).

Add a video into splash screen or in the first view of the app (IOS xcode 4.0)

I'm a beginner in IOS but I need to show a video when the app is launching.
Please Can you help me?
If is impossible to implement a video on a splash view, there are any idea to create that?
Thanks.
If I have an orthographic mistake, sorry I come from Spain. ;D
The "splash" screen can only be an image to be used as a placeholder until your app is able to start up. Even if you found a way to get a video to play, which I don't think is possible, it is against Apple's HIG for how the startup screen is supposed to be used.
It would be possible to load your video in its own view immediately after the splash screen. You would need to check for a first time run to determine whether to show it, unless you plan to show it each and every time. Hope this helps.
Apple Human Interface Guide

Best way to create floating notification iOS

I've got a tabbed iPad application with just about each tab running a UIWebView. I'm getting all sorts of callbacks, like when a user tries to leave the corporate site (which only displays the company site to users). In this case, I pop up a "toast" style window that tells them to click a button to open the page in Safari. I also pop it up with a spinner and no text to indicate that a page is loading. The approximate look that I'm going for is used in lots of applications, but you can see it best when changing the volume on the iPhone or iPad. It's just a translucent rounded square that fades in and out.
Right now I've got it implemented on one of my tabs, and I did it by creating the objects (a spinner, a label, and a UIImage with the square) and then programmatically hiding and showing them using [UIView beginAnimations] and changing the label's text. It works perfectly but I've got these nagging things hovering over my interface in Xcode, and it takes a lot of setup to accomplish if I wanted it to be in another tab, which I do. I can't help but think that there's a better way to accomplish this. I thought about making and adding a subview, but that would leave a white background to the toast. What I'm thinking is creating some sort of object that I can allocate in a tab's view controller whenever it's needed.
What are your guys ideas, or have you done this in the past? I see it in a lot of prominent applications, like Reeder, so I'm sure it's been done more eloquently than I have done it.
Matt Gallagher has a great class called LoadingView here Showing message over iPhone Keyboard. I use it.
MBProgressHUD is a popular library for this, as well.