touch events on statusbar

Discussion in 'iPhone/iPad Programming' started by thevibesman, Dec 23, 2008.

  1. macrumors regular

    Joined:
    Oct 26, 2007
    #1
    Is it possible to detect touch events on the status bar like the double-tap action in safari? The best lead I got from googling was that the object for the statusbar is private so maybe not legit to use. My attempts to expand views into the status bar area so far haven't worked. Any ideas?
     
  2. macrumors newbie

    Joined:
    Dec 23, 2008
    #2
    I was wondering this recently too. Either there are some notifications for it, or then maybe you could get around it somehow. I noticed that if you have UITextView on your view, the statusbar is detected as a tap/scroll to the begining of the view. Add UITextView and detect it's scroll..? just small workaround and should be "App Store" safe if you think it as just using published UITextView API.
     
  3. thread starter macrumors regular

    Joined:
    Oct 26, 2007
    #3
    I read about that UITextView solution, but that won't work for me. I am hoping to get touch location information so I can split the status bar up into 3 or 4 sections to make multiple hidden buttons out of the status bar.
     
  4. macrumors G3

    TuffLuffJimmy

    Joined:
    Apr 6, 2007
    Location:
    Portland, OR
    #4
    I'm no programmer, but wouldn't it be possible to just make invisible buttons that are right next to the status bar? Since the status bar is so small the user would hit the buttons anyway.
     
  5. thread starter macrumors regular

    Joined:
    Oct 26, 2007
    #5
    Basically, I'm designing some apps that need every pixel of space available on the screen for tracking touches (the multiple buttons on the status bar is just one example). I don't want to hide the status bar because I'd still like to show the cell, WiFi, and battery status to the user but without sacrificing any of my possible touch areas. Since I am not trying to emulate existing statusbar touch uses, faking it in any way really won't do the trick for me because I really would like to have specific UITouches delivered when the user touches those top 20 pixels.
     
  6. Pim
    macrumors member

    Joined:
    Jun 4, 2007
    #6
    I thought it was an automatic event for any scrollview, but that doesn't appear to be the case. I'm going to look into this.
     
  7. macrumors 6502a

    Joined:
    Mar 13, 2008
    #7
    Apple allows access to all the information in the status bar, so you could hide the status bar, simulate it by redrawing everything yourself as separate items, then put your invisible buttons there. That way you could customize the status bar to fit the theme of your app too if you want.
     
  8. thread starter macrumors regular

    Joined:
    Oct 26, 2007
    #8

    Really? That would be ideal because then I wouldn't need to waste space with the status bar at all and could just show battery/connectivity (no need for time and perhaps I could even streamline those graphics more.

    I couldn't find anything in the documentation related to this, care to point out which class reference I need to check out?
     
  9. macrumors 6502a

    Joined:
    Mar 13, 2008
    #9
    I think I mis-worded what I said, I made it a tad too definite. I have seen apps that tell you the time, and others with wifi data. But I haven't looked for(or seen) any official classes. Sorry if I ended up misleading you. They may be there, but I haven't seen them myself.
     
  10. thread starter macrumors regular

    Joined:
    Oct 26, 2007
    #10
    The phone obviously has functions/methods to call to get this info to display it in the status bar, but from searching around it seems like Apple doesn't allow it (i.e. private APIs) from everything I've read on the developer site.

    I too have seen apps that can tell WiFi network strength and battery status (time doesn't really count, that is easy is every software environment I've ever dealt with) and am a little confused by this because all official word seems to say this isn't supported. I found some references to private frameworks on code.google.com to help with WiFi related info. So what do you guys think, are these WiFi/battery status apps breaking rules in the use of private APIs and somehow Apple didn't notice during the approval process or do you think there is some undocumented work around that Apple considers legit yet unsupported? I'd really like to be able to handle battery, WiFi, and cell info in my own way in some of my apps but am a little nervous about wasting much more time pursuing a solution to have Apple tell me I can't do it when I submit my app.
     
  11. macrumors 6502a

    Joined:
    Mar 13, 2008
    #11
    I don't think apple will mind as long as the overall scheme is within limits. A way to possibly be safer, however, is to simply duplicate exactly one of the existing styles except for of course the buttons.
     
  12. thread starter macrumors regular

    Joined:
    Oct 26, 2007
    #12
    Look and feel is not the issue. As far as I can figure out the only way to get this information is via private APIs which as I understand would be a violation of the SDK agreement and not be allowed on the store. So it is a question of code, not interface, but are the applications that are accessing WiFi/cell/battery info somehow getting under Apple's radar re: the use of private APIs, or is there a legit way to CODE this.
     

Share This Page