matsuda
11/8/2012 - 8:38 AM

アプリ起動時、バックグランドからの復帰時の傾きを考慮したview情報を取得するサンプル

アプリ起動時、バックグランドからの復帰時の傾きを考慮したview情報を取得するサンプル

2012-11-12 12:37:25.757 TestInterfaceOrientation[16012:c07] -[AppDelegate application:didFinishLaunchingWithOptions:]
2012-11-12 12:37:25.758 TestInterfaceOrientation[16012:c07] frame >>>>>>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:37:25.758 TestInterfaceOrientation[16012:c07] bounds >>>>>>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:37:25.760 TestInterfaceOrientation[16012:c07] -[WithNaviViewController viewDidLoad]
2012-11-12 12:37:25.760 TestInterfaceOrientation[16012:c07] ################ window ################
2012-11-12 12:37:25.760 TestInterfaceOrientation[16012:c07] frame  (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-12 12:37:25.760 TestInterfaceOrientation[16012:c07] bounds (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-12 12:37:25.760 TestInterfaceOrientation[16012:c07] ################  navi  ################
2012-11-12 12:37:25.761 TestInterfaceOrientation[16012:c07] frame  (navi)   >>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:37:25.761 TestInterfaceOrientation[16012:c07] bounds (navi)   >>>>>>> {{0, 0}, {1024, 768}}
2012-11-12 12:37:25.761 TestInterfaceOrientation[16012:c07] ################  view  ################
2012-11-12 12:37:25.761 TestInterfaceOrientation[16012:c07] frame  (view)   >>>>>>> {{20, 0}, {748, 1024}}
2012-11-12 12:37:25.761 TestInterfaceOrientation[16012:c07] bounds (view)   >>>>>>> {{0, 0}, {748, 1024}}
2012-11-12 12:37:25.761 TestInterfaceOrientation[16012:c07] -[WithNaviViewController viewWillAppear:]
2012-11-12 12:37:25.762 TestInterfaceOrientation[16012:c07] ################ window ################
2012-11-12 12:37:25.762 TestInterfaceOrientation[16012:c07] frame  (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-12 12:37:25.762 TestInterfaceOrientation[16012:c07] bounds (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-12 12:37:25.762 TestInterfaceOrientation[16012:c07] ################  navi  ################
2012-11-12 12:37:25.762 TestInterfaceOrientation[16012:c07] frame  (navi)   >>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:37:25.762 TestInterfaceOrientation[16012:c07] bounds (navi)   >>>>>>> {{0, 0}, {1024, 768}}
2012-11-12 12:37:25.763 TestInterfaceOrientation[16012:c07] ################  view  ################
2012-11-12 12:37:25.763 TestInterfaceOrientation[16012:c07] frame  (view)   >>>>>>> {{0, 0}, {1024, 704}}
2012-11-12 12:37:25.763 TestInterfaceOrientation[16012:c07] bounds (view)   >>>>>>> {{0, 0}, {1024, 704}}
2012-11-12 12:37:25.764 TestInterfaceOrientation[16012:c07] -[AppDelegate applicationDidBecomeActive:]
2012-11-12 12:37:25.764 TestInterfaceOrientation[16012:c07] frame >>>>>>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:37:25.764 TestInterfaceOrientation[16012:c07] bounds >>>>>>>>>>> {{0, 0}, {1024, 768}}
2012-11-12 12:37:25.769 TestInterfaceOrientation[16012:c07] -[WithNaviViewController viewDidAppear:]
2012-11-12 12:37:25.769 TestInterfaceOrientation[16012:c07] ################ window ################
2012-11-12 12:37:25.769 TestInterfaceOrientation[16012:c07] frame  (window) >>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:37:25.770 TestInterfaceOrientation[16012:c07] bounds (window) >>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:37:25.770 TestInterfaceOrientation[16012:c07] ################  navi  ################
2012-11-12 12:37:25.770 TestInterfaceOrientation[16012:c07] frame  (navi)   >>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:37:25.770 TestInterfaceOrientation[16012:c07] bounds (navi)   >>>>>>> {{0, 0}, {1024, 768}}
2012-11-12 12:37:25.770 TestInterfaceOrientation[16012:c07] ################  view  ################
2012-11-12 12:37:25.770 TestInterfaceOrientation[16012:c07] frame  (view)   >>>>>>> {{0, 0}, {1024, 704}}
2012-11-12 12:37:25.771 TestInterfaceOrientation[16012:c07] bounds (view)   >>>>>>> {{0, 0}, {1024, 704}}
2012-11-12 12:37:28.957 TestInterfaceOrientation[16012:c07] -[AppDelegate applicationWillEnterForeground:]
2012-11-12 12:37:28.957 TestInterfaceOrientation[16012:c07] frame >>>>>>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:37:28.957 TestInterfaceOrientation[16012:c07] bounds >>>>>>>>>>> {{0, 0}, {1024, 768}}
2012-11-12 12:37:28.958 TestInterfaceOrientation[16012:c07] -[AppDelegate applicationDidBecomeActive:]
2012-11-12 12:37:28.959 TestInterfaceOrientation[16012:c07] frame >>>>>>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:37:28.959 TestInterfaceOrientation[16012:c07] bounds >>>>>>>>>>> {{0, 0}, {1024, 768}}
2012-11-12 12:36:50.732 TestInterfaceOrientation[15970:c07] -[AppDelegate application:didFinishLaunchingWithOptions:]
2012-11-12 12:36:50.733 TestInterfaceOrientation[15970:c07] frame >>>>>>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:50.733 TestInterfaceOrientation[15970:c07] bounds >>>>>>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:50.735 TestInterfaceOrientation[15970:c07] -[WithNaviViewController viewDidLoad]
2012-11-12 12:36:50.735 TestInterfaceOrientation[15970:c07] ################ window ################
2012-11-12 12:36:50.735 TestInterfaceOrientation[15970:c07] frame  (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-12 12:36:50.736 TestInterfaceOrientation[15970:c07] bounds (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-12 12:36:50.736 TestInterfaceOrientation[15970:c07] ################  navi  ################
2012-11-12 12:36:50.736 TestInterfaceOrientation[15970:c07] frame  (navi)   >>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:50.737 TestInterfaceOrientation[15970:c07] bounds (navi)   >>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:50.737 TestInterfaceOrientation[15970:c07] ################  view  ################
2012-11-12 12:36:50.737 TestInterfaceOrientation[15970:c07] frame  (view)   >>>>>>> {{0, 20}, {768, 1004}}
2012-11-12 12:36:50.738 TestInterfaceOrientation[15970:c07] bounds (view)   >>>>>>> {{0, 0}, {768, 1004}}
2012-11-12 12:36:50.738 TestInterfaceOrientation[15970:c07] -[WithNaviViewController viewWillAppear:]
2012-11-12 12:36:50.739 TestInterfaceOrientation[15970:c07] ################ window ################
2012-11-12 12:36:50.739 TestInterfaceOrientation[15970:c07] frame  (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-12 12:36:50.739 TestInterfaceOrientation[15970:c07] bounds (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-12 12:36:50.740 TestInterfaceOrientation[15970:c07] ################  navi  ################
2012-11-12 12:36:50.740 TestInterfaceOrientation[15970:c07] frame  (navi)   >>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:50.740 TestInterfaceOrientation[15970:c07] bounds (navi)   >>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:50.741 TestInterfaceOrientation[15970:c07] ################  view  ################
2012-11-12 12:36:50.741 TestInterfaceOrientation[15970:c07] frame  (view)   >>>>>>> {{0, 0}, {768, 960}}
2012-11-12 12:36:50.741 TestInterfaceOrientation[15970:c07] bounds (view)   >>>>>>> {{0, 0}, {768, 960}}
2012-11-12 12:36:50.742 TestInterfaceOrientation[15970:c07] -[AppDelegate applicationDidBecomeActive:]
2012-11-12 12:36:50.742 TestInterfaceOrientation[15970:c07] frame >>>>>>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:50.743 TestInterfaceOrientation[15970:c07] bounds >>>>>>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:50.747 TestInterfaceOrientation[15970:c07] -[WithNaviViewController viewDidAppear:]
2012-11-12 12:36:50.747 TestInterfaceOrientation[15970:c07] ################ window ################
2012-11-12 12:36:50.748 TestInterfaceOrientation[15970:c07] frame  (window) >>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:50.749 TestInterfaceOrientation[15970:c07] bounds (window) >>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:50.749 TestInterfaceOrientation[15970:c07] ################  navi  ################
2012-11-12 12:36:50.750 TestInterfaceOrientation[15970:c07] frame  (navi)   >>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:50.751 TestInterfaceOrientation[15970:c07] bounds (navi)   >>>>>>> {{0, 0}, {1024, 768}}
2012-11-12 12:36:50.751 TestInterfaceOrientation[15970:c07] ################  view  ################
2012-11-12 12:36:50.751 TestInterfaceOrientation[15970:c07] frame  (view)   >>>>>>> {{0, 0}, {1024, 704}}
2012-11-12 12:36:50.752 TestInterfaceOrientation[15970:c07] bounds (view)   >>>>>>> {{0, 0}, {1024, 704}}
2012-11-12 12:36:53.872 TestInterfaceOrientation[15970:c07] -[AppDelegate applicationWillEnterForeground:]
2012-11-12 12:36:53.873 TestInterfaceOrientation[15970:c07] frame >>>>>>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:53.873 TestInterfaceOrientation[15970:c07] bounds >>>>>>>>>>> {{0, 0}, {1024, 768}}
2012-11-12 12:36:53.874 TestInterfaceOrientation[15970:c07] -[AppDelegate applicationDidBecomeActive:]
2012-11-12 12:36:53.874 TestInterfaceOrientation[15970:c07] frame >>>>>>>>>>> {{0, 0}, {768, 1024}}
2012-11-12 12:36:53.875 TestInterfaceOrientation[15970:c07] bounds >>>>>>>>>>> {{0, 0}, {1024, 768}}
@implementation WithNaviViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    NSLog(@"%s", __func__);
    [self logView];
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    NSLog(@"%s", __func__);
    [self logView];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    NSLog(@"%s", __func__);
    [self logView];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)logView
{
    NSLog(@"################ window ################");
    NSLog(@"frame  (window) >>>>>>> %@", NSStringFromCGRect(self.view.window.frame));
    NSLog(@"bounds (window) >>>>>>> %@", NSStringFromCGRect(self.view.window.bounds));
    NSLog(@"################  navi  ################");
    NSLog(@"frame  (navi)   >>>>>>> %@", NSStringFromCGRect(self.navigationController.view.frame));
    NSLog(@"bounds (navi)   >>>>>>> %@", NSStringFromCGRect(self.navigationController.view.bounds));
    NSLog(@"################  view  ################");
    NSLog(@"frame  (view)   >>>>>>> %@", NSStringFromCGRect(self.view.frame));
    NSLog(@"bounds (view)   >>>>>>> %@", NSStringFromCGRect(self.view.bounds));
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

@end
2012-11-08 17:39:49.644 TestInterfaceOrientation[28013:c07] -[AppDelegate application:didFinishLaunchingWithOptions:]
2012-11-08 17:39:49.645 TestInterfaceOrientation[28013:c07] -[ViewController viewDidLoad]
2012-11-08 17:39:49.645 TestInterfaceOrientation[28013:c07] ################ window ################
2012-11-08 17:39:49.646 TestInterfaceOrientation[28013:c07] frame  (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-08 17:39:49.646 TestInterfaceOrientation[28013:c07] bounds (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-08 17:39:49.646 TestInterfaceOrientation[28013:c07] ################  view  ################
2012-11-08 17:39:49.646 TestInterfaceOrientation[28013:c07] frame  (view)   >>>>>>> {{20, 0}, {748, 1024}}
2012-11-08 17:39:49.646 TestInterfaceOrientation[28013:c07] bounds (view)   >>>>>>> {{0, 0}, {748, 1024}}
2012-11-08 17:39:49.646 TestInterfaceOrientation[28013:c07] frame >>>>>>>>>>> {{20, 0}, {748, 1024}}
2012-11-08 17:39:49.647 TestInterfaceOrientation[28013:c07] bounds >>>>>>>>>>> {{0, 0}, {748, 1024}}
2012-11-08 17:39:49.647 TestInterfaceOrientation[28013:c07] -[ViewController viewWillAppear:]
2012-11-08 17:39:49.647 TestInterfaceOrientation[28013:c07] ################ window ################
2012-11-08 17:39:49.667 TestInterfaceOrientation[28013:c07] frame  (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-08 17:39:49.667 TestInterfaceOrientation[28013:c07] bounds (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-08 17:39:49.667 TestInterfaceOrientation[28013:c07] ################  view  ################
2012-11-08 17:39:49.667 TestInterfaceOrientation[28013:c07] frame  (view)   >>>>>>> {{20, 0}, {748, 1024}}
2012-11-08 17:39:49.668 TestInterfaceOrientation[28013:c07] bounds (view)   >>>>>>> {{0, 0}, {748, 1024}}
2012-11-08 17:39:49.668 TestInterfaceOrientation[28013:c07] -[AppDelegate applicationDidBecomeActive:]
2012-11-08 17:39:49.669 TestInterfaceOrientation[28013:c07] frame >>>>>>>>>>> {{20, 0}, {748, 1024}}
2012-11-08 17:39:49.669 TestInterfaceOrientation[28013:c07] bounds >>>>>>>>>>> {{0, 0}, {1024, 748}}
2012-11-08 17:39:49.674 TestInterfaceOrientation[28013:c07] -[ViewController viewDidAppear:]
2012-11-08 17:39:49.674 TestInterfaceOrientation[28013:c07] ################ window ################
2012-11-08 17:39:49.674 TestInterfaceOrientation[28013:c07] frame  (window) >>>>>>> {{0, 0}, {768, 1024}}
2012-11-08 17:39:49.674 TestInterfaceOrientation[28013:c07] bounds (window) >>>>>>> {{0, 0}, {768, 1024}}
2012-11-08 17:39:49.674 TestInterfaceOrientation[28013:c07] ################  view  ################
2012-11-08 17:39:49.674 TestInterfaceOrientation[28013:c07] frame  (view)   >>>>>>> {{20, 0}, {748, 1024}}
2012-11-08 17:39:49.675 TestInterfaceOrientation[28013:c07] bounds (view)   >>>>>>> {{0, 0}, {1024, 748}}
2012-11-08 17:39:54.880 TestInterfaceOrientation[28013:c07] -[AppDelegate applicationWillEnterForeground:]
2012-11-08 17:39:54.880 TestInterfaceOrientation[28013:c07] frame >>>>>>>>>>> {{20, 0}, {748, 1024}}
2012-11-08 17:39:54.880 TestInterfaceOrientation[28013:c07] bounds >>>>>>>>>>> {{0, 0}, {1024, 748}}
2012-11-08 17:39:54.881 TestInterfaceOrientation[28013:c07] -[AppDelegate applicationDidBecomeActive:]
2012-11-08 17:39:54.881 TestInterfaceOrientation[28013:c07] frame >>>>>>>>>>> {{20, 0}, {748, 1024}}
2012-11-08 17:39:54.881 TestInterfaceOrientation[28013:c07] bounds >>>>>>>>>>> {{0, 0}, {1024, 748}}
2012-11-08 17:39:13.637 TestInterfaceOrientation[27859:c07] -[AppDelegate application:didFinishLaunchingWithOptions:]
2012-11-08 17:39:13.639 TestInterfaceOrientation[27859:c07] -[ViewController viewDidLoad]
2012-11-08 17:39:13.639 TestInterfaceOrientation[27859:c07] ################ window ################
2012-11-08 17:39:13.640 TestInterfaceOrientation[27859:c07] frame  (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-08 17:39:13.641 TestInterfaceOrientation[27859:c07] bounds (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-08 17:39:13.642 TestInterfaceOrientation[27859:c07] ################  view  ################
2012-11-08 17:39:13.643 TestInterfaceOrientation[27859:c07] frame  (view)   >>>>>>> {{0, 20}, {768, 1004}}
2012-11-08 17:39:13.644 TestInterfaceOrientation[27859:c07] bounds (view)   >>>>>>> {{0, 0}, {768, 1004}}
2012-11-08 17:39:13.644 TestInterfaceOrientation[27859:c07] frame >>>>>>>>>>> {{0, 20}, {768, 1004}}
2012-11-08 17:39:13.645 TestInterfaceOrientation[27859:c07] bounds >>>>>>>>>>> {{0, 0}, {768, 1004}}
2012-11-08 17:39:13.646 TestInterfaceOrientation[27859:c07] -[ViewController viewWillAppear:]
2012-11-08 17:39:13.646 TestInterfaceOrientation[27859:c07] ################ window ################
2012-11-08 17:39:13.647 TestInterfaceOrientation[27859:c07] frame  (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-08 17:39:13.696 TestInterfaceOrientation[27859:c07] bounds (window) >>>>>>> {{0, 0}, {0, 0}}
2012-11-08 17:39:13.697 TestInterfaceOrientation[27859:c07] ################  view  ################
2012-11-08 17:39:13.698 TestInterfaceOrientation[27859:c07] frame  (view)   >>>>>>> {{0, 20}, {768, 1004}}
2012-11-08 17:39:13.698 TestInterfaceOrientation[27859:c07] bounds (view)   >>>>>>> {{0, 0}, {768, 1004}}
2012-11-08 17:39:13.699 TestInterfaceOrientation[27859:c07] -[AppDelegate applicationDidBecomeActive:]
2012-11-08 17:39:13.700 TestInterfaceOrientation[27859:c07] frame >>>>>>>>>>> {{0, 20}, {768, 1004}}
2012-11-08 17:39:13.701 TestInterfaceOrientation[27859:c07] bounds >>>>>>>>>>> {{0, 0}, {768, 1004}}
2012-11-08 17:39:13.704 TestInterfaceOrientation[27859:c07] -[ViewController viewDidAppear:]
2012-11-08 17:39:13.705 TestInterfaceOrientation[27859:c07] ################ window ################
2012-11-08 17:39:13.706 TestInterfaceOrientation[27859:c07] frame  (window) >>>>>>> {{0, 0}, {768, 1024}}
2012-11-08 17:39:13.707 TestInterfaceOrientation[27859:c07] bounds (window) >>>>>>> {{0, 0}, {768, 1024}}
2012-11-08 17:39:13.716 TestInterfaceOrientation[27859:c07] ################  view  ################
2012-11-08 17:39:13.716 TestInterfaceOrientation[27859:c07] frame  (view)   >>>>>>> {{20, 0}, {748, 1024}}
2012-11-08 17:39:13.717 TestInterfaceOrientation[27859:c07] bounds (view)   >>>>>>> {{0, 0}, {1024, 748}}
2012-11-08 17:39:27.596 TestInterfaceOrientation[27859:c07] -[AppDelegate applicationWillEnterForeground:]
2012-11-08 17:39:27.596 TestInterfaceOrientation[27859:c07] frame >>>>>>>>>>> {{20, 0}, {748, 1024}}
2012-11-08 17:39:27.596 TestInterfaceOrientation[27859:c07] bounds >>>>>>>>>>> {{0, 0}, {1024, 748}}
2012-11-08 17:39:27.597 TestInterfaceOrientation[27859:c07] -[AppDelegate applicationDidBecomeActive:]
2012-11-08 17:39:27.598 TestInterfaceOrientation[27859:c07] frame >>>>>>>>>>> {{20, 0}, {748, 1024}}
2012-11-08 17:39:27.598 TestInterfaceOrientation[27859:c07] bounds >>>>>>>>>>> {{0, 0}, {1024, 748}}
@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSLog(@"%s", __func__);
    [self logView];
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    NSLog(@"%s", __func__);
    [self logView];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    NSLog(@"%s", __func__);
    [self logView];
}

- (void)logView
{
    NSLog(@"################ window ################");
    NSLog(@"frame  (window) >>>>>>> %@", NSStringFromCGRect(self.view.window.frame));
    NSLog(@"bounds (window) >>>>>>> %@", NSStringFromCGRect(self.view.window.bounds));
    NSLog(@"################  view  ################");
    NSLog(@"frame  (view)   >>>>>>> %@", NSStringFromCGRect(self.view.frame));
    NSLog(@"bounds (view)   >>>>>>> %@", NSStringFromCGRect(self.view.bounds));
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

@end
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    NSLog(@"%s", __func__);
    UIViewController *controller = self.window.rootViewController;
    NSLog(@"frame >>>>>>>>>>> %@", NSStringFromCGRect(controller.view.frame));
    NSLog(@"bounds >>>>>>>>>>> %@", NSStringFromCGRect(controller.view.bounds));
    return YES;
}
							
- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
    NSLog(@"%s", __func__);
    UIViewController *controller = self.window.rootViewController;
    NSLog(@"frame >>>>>>>>>>> %@", NSStringFromCGRect(controller.view.frame));
    NSLog(@"bounds >>>>>>>>>>> %@", NSStringFromCGRect(controller.view.bounds));
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    NSLog(@"%s", __func__);
    UIViewController *controller = self.window.rootViewController;
    NSLog(@"frame >>>>>>>>>>> %@", NSStringFromCGRect(controller.view.frame));
    NSLog(@"bounds >>>>>>>>>>> %@", NSStringFromCGRect(controller.view.bounds));
}

@end