Added explicit dependencies for AddTopView and AddBottomView of SwappedViewAdditionViewDidLoad.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation ViewController | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
[self reallyImportantMethod]; | |
[self anotherImportantMethod]; | |
[self addSubviews]; | |
[self validateStaleData]; | |
} | |
#pragma mark - Setups - | |
- (void)addSubviews | |
{ | |
CGFloat viewWidth = self.view.frame.size.width; | |
CGFloat topViewYPosition = 64.0f; | |
CGFloat topViewHeight = 100.0f; | |
CGFloat bottomViewYPosition = topViewYPosition + topViewHeight; | |
CGFloat bottomViewHeight = 150.0f; | |
[self addBottomViewAtYPosition:bottomViewYPosition | |
withWidth:viewWidth | |
andHeight:bottomViewHeight]; | |
[self addTopViewAtYPosition:topViewYPosition | |
withWidth:viewWidth | |
andHeight:topViewHeight]; | |
} | |
- (void)addTopViewAtYPosition:(CGFloat)yPosition | |
withWidth:(CGFloat)topViewWidth | |
andHeight:(CGFloat)topViewHeight | |
{ | |
CGRect topViewFrame = CGRectMake(0, yPosition, topViewWidth, topViewHeight); | |
UIView *topView = [[UIView alloc] initWithFrame:topViewFrame]; | |
topView.backgroundColor = [UIColor redColor]; | |
UILabel *title = [self titleLabelForTopViewWidth:topViewWidth | |
height:topViewHeight]; | |
[topView addSubview:title]; | |
[self.view addSubview:topView]; | |
} | |
// rest of the code ... | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment