Swiftgram/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m
Hannah Troisi 4e8d835280 [ASDKgram example update] addressed PR comments
- overrode the -(void)fetchData method in PhotoCellNode.m to download the photo’s comments. This method gets called with the PhotoCellNode enters ASInterfaceStateFetchData, which is set by the rangeController.
    - UIKIT COMPARISON: I left the comment bulk download (for all photos in a page load) in the PhotoFeedViewController side for UIKit because when implemented in the PhotoTableViewCell, each cell jumped around as it changed size when it came on screen.
- minor appearance updates
    - updated color scheme
    - fixed status bar style to darkBackgroundColor
- cleaned up layoutSpecThatFits: in PhotoCellNode
2016-04-14 00:52:05 -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];
CGRect statusBarFrame = CGRectZero;
statusBarFrame.size.width = [[UIScreen mainScreen] bounds].size.width;
statusBarFrame.size.height = [[UIApplication sharedApplication] statusBarFrame].size.height;
_statusBarOpaqueUnderlayView.frame = statusBarFrame;
}
@end