iOS Screen size based on orientation

//Get current screen size based on the orientation of the device

-(CGSize) currentSize
{
    return [self sizeInOrientation:[UIApplication sharedApplication].statusBarOrientation];
}

-(CGSize) sizeInOrientation:(UIInterfaceOrientation)orientation
{
    
    CGFloat scale = [[UIScreen mainScreen] scale];
    CGSize size = [UIScreen mainScreen].bounds.size;
    
    if (UIInterfaceOrientationIsLandscape(orientation))
    {
        size = CGSizeMake(size.height*scale, size.width * scale);
    }
    return size;
}

-(void) viewDidAppear:(BOOL)animated    {
    
    CGSize size = [self currentSize];

    NSLog(@"%f",size.height);
    NSLog(@"%f",size.width);

}