Last active
August 29, 2015 14:24
-
-
Save wethu/424159dec01ae8b7d1b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDelegate.m | |
// codeonly | |
// | |
// Created by Ellis Gray on 23/06/2015. | |
// Copyright (c) 2015 Ellis Gray. All rights reserved. | |
// | |
#import "AppDelegate.h" | |
@interface AppDelegate () <UITableViewDataSource, UITableViewDelegate> | |
@end | |
@implementation AppDelegate | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
_window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | |
UIViewController *controller = [UIViewController new]; | |
UICollectionViewLayout *layout = [[UICollectionViewLayout alloc]init]; | |
UICollectionView *collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(100, 100, 100, 100) collectionViewLayout:layout]; | |
collectionView.backgroundColor = [UIColor whiteColor]; | |
[controller.view addSubview:collectionView]; | |
[controller.view layoutIfNeeded]; | |
CGFloat height = collectionView.frame.size.height * 0.626f; | |
NSLog(@"Height: %f", height); // I get 62.59999999 | |
_window.rootViewController = controller; | |
[_window makeKeyAndVisible]; | |
return YES; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment