Skip to content

Commit 4124e37

Browse files
committed
Merge pull request #4675 from wordpress-mobile/issue/4665-jetpack-settings-jump
Move the awful layout code into the right lifecycle method
2 parents 8f59f4b + 519bcb8 commit 4124e37

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

WordPress/Classes/ViewRelated/Stats/JetpackSettingsViewController.m

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ @implementation JetpackSettingsViewController
7575

7676
- (instancetype)initWithBlog:(Blog *)blog
7777
{
78-
self = [super init];
78+
self = [self init];
7979
if (self) {
8080
_blog = blog;
8181
_showFullScreen = YES;
@@ -95,6 +95,8 @@ - (BOOL)hidesBottomBarWhenPushed
9595

9696
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
9797
{
98+
[super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
99+
98100
[self layoutControls];
99101
}
100102

@@ -104,9 +106,23 @@ - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInte
104106
- (void)viewWillAppear:(BOOL)animated
105107
{
106108
[super viewWillAppear:animated];
109+
107110
[self.navigationController setNavigationBarHidden:self.showFullScreen animated:animated];
111+
}
112+
113+
- (void)viewDidLayoutSubviews
114+
{
115+
[super viewDidLayoutSubviews];
116+
108117
[self reloadInterface];
109118
[self updateForm];
119+
}
120+
121+
122+
- (void)viewDidAppear:(BOOL)animated
123+
{
124+
[super viewDidAppear:animated];
125+
110126
[self checkForJetpack];
111127
}
112128

@@ -130,13 +146,6 @@ - (void)viewDidLoad
130146
[self addSkipButtonIfNeeded];
131147
}
132148

133-
// This resolves a crash due to JetpackSettingsViewController previously using a .xib.
134-
// Source: http://stackoverflow.com/questions/17708292/not-key-value-coding-compliant-error-from-deleted-xib
135-
- (void)loadView
136-
{
137-
[super loadView];
138-
}
139-
140149
- (void)addControls
141150
{
142151
// Add Logo

0 commit comments

Comments
 (0)