You should put this function on appDelegate, this will trigger when the status bar change
- (void)application:(UIApplication *)application didChangeStatusBarFrame (CGRect)oldStatusBarFrame
{
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
[dict setObject:@"trigger" forKey:@"frame"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"trigger"
object:self
userInfo:dict];
}
This Code will send Notification with the name "trigger"
Place a code to your view Controller (e.g: viewDidLoad, etc..) this listen if there are notification send with a name "trigger"
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(dataReceived:)
name:@"trigger"
object:nil];
And create a function dataReceived:
- (void)dataReceivedNotification:(NSNotification*)notification
{
NSDictionary* data = [notification userInfo];
// do something with data
}
do something on this part of the code, maybe you change the frame of your tab bar, uiview frame, toolbar frame
And in delloc, put this code to remove the observer
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}