//
//  AdsViewController.m
//  Stylist
//
//  Created by VCC on 10/7/13.
//  Copyright (c) 2013 VCC. All rights reserved.
//

#import "AdsViewController.h"
#import "AppDelegate.h"
@interface AdsViewController ()

@end

@implementation AdsViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    
}

- (void)viewWillAppear:(BOOL)animated
{
	[super viewWillAppear:animated];

    isPresent = [self appDelegate].isPresentModel;
    if(isPresent) {
        float systemVersion=[[[UIDevice currentDevice] systemVersion] floatValue];
        if(systemVersion>=7.0)
        {
            CGRect tempRect;
            for(UIView *sub in [[self view] subviews])
            {
                tempRect = [sub frame];
                tempRect.origin.y += 20.0f; //Height of status bar
                [sub setFrame:tempRect];
            }
            isPresent = NO;
        }

    }
}

- (AppDelegate *)appDelegate
{
    return (AppDelegate *)[UIApplication sharedApplication].delegate;
}

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

// ステータスバースタイル iOS9対応	ADD 2016-01-13
- (UIStatusBarStyle)preferredStatusBarStyle
{
	return [self appDelegate].statusBarStyle;
}

@end
