Disabling the Personal hotspot notification

KP26 picture KP26 · Mar 20, 2014 · Viewed 12.6k times · Source

Enabling personal hot spot pushing down the view and related subviews pushing down. How to disable the personal hotspot notification programmatically? (how can i restrict iPhone status bar to original size even when HOT SPOT is on?)

Answer

Mike Critchley picture Mike Critchley · Apr 1, 2015

I found rather late that the Personal Hotspot doesn't just add 20points to the status bar, it messes up views that rely on drop points in an animator with gravity. I added code that checks the status bar height before laying out the views. If it's not 20, then it's probably the hotspot, so I just hide the status bar. Not an ideal solution, but works so far.

- (BOOL)prefersStatusBarHidden {
    if ([UIApplication sharedApplication].statusBarFrame.size.height == 20) {
        NSLog(@"Status bar is 20 so returning NO for hidden");
        return NO;
    }
    NSLog(@"Status bar is not 20 so returning YES for hidden");
    return YES;
}