Files
Swiftgram/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m
Hannah Troisi 44d483b7fe [New Example] 500pxgram updates
- addressed all comments in PR except autolayout of UIKit code
2016-04-10 23:34:41 -07:00

41 lines
1.0 KiB
Objective-C

//
// WindowWithStatusBarUnderlay.m
// Sample
//
// Created by Hannah Troisi on 4/10/16.
// Copyright © 2016 Facebook. All rights reserved.
//
#import "WindowWithStatusBarUnderlay.h"
#import "Utilities.h"
@implementation WindowWithStatusBarUnderlay
{
UIView *_statusBarOpaqueUnderlayView;
}
-(instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
_statusBarOpaqueUnderlayView = [[UIView alloc] init];
_statusBarOpaqueUnderlayView.backgroundColor = [UIColor darkBlueColor];
[self addSubview:_statusBarOpaqueUnderlayView];
}
return self;
}
-(void)layoutSubviews
{
[super layoutSubviews];
[self bringSubviewToFront:_statusBarOpaqueUnderlayView];
_statusBarOpaqueUnderlayView.frame = CGRectMake(0,
0,
[[UIScreen mainScreen] bounds].size.width,
[[UIApplication sharedApplication] statusBarFrame].size.height);
}
@end