Last active
September 26, 2015 11:56
-
-
Save edopelawi/b05f38ea01257632d1a0 to your computer and use it in GitHub Desktop.
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