wethu
7/10/2015 - 7:28 AM

app.m

//
//  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