I am running a test program with a sample view controller .
In my app delegate , I have the following
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
NSLog(@"window frame %@",NSStringFromCGRect(self.window.frame));
}
The output is window frame {{0, 0}, {768, 1024}}.
I have the device in lanscape mode but the window frame returns a swapped value of width and height .
I am not able to place my view components using hard coded values because of this .
Any clues what is going wrong.
You are trying to get the size of the view before this function is called…
This only gets called after
exits. Is there a reason you need to do it inside of this function? I would try doing it inside of your UIViewControllers viewDidLoad function instead.
Hope this helps 🙂