Skip to content

Commit 06de4c8

Browse files
Incorporate fix from mattgemmell#68
1 parent ed72bcf commit 06de4c8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Classes/MGSplitViewController.m

+10-4
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,18 @@ - (void)dealloc
149149

150150
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
151151
{
152-
if (self.detailViewController)
153-
{
152+
if (self.masterViewController && self.detailViewController) {
153+
return [self.masterViewController shouldAutorotateToInterfaceOrientation:interfaceOrientation] && [self.detailViewController shouldAutorotateToInterfaceOrientation:interfaceOrientation];
154+
}
155+
else if (self.masterViewController) {
156+
return [self.masterViewController shouldAutorotateToInterfaceOrientation:interfaceOrientation];
157+
}
158+
else if (self.detailViewController) {
154159
return [self.detailViewController shouldAutorotateToInterfaceOrientation:interfaceOrientation];
155160
}
156-
157-
return YES;
161+
else {
162+
return YES;
163+
}
158164
}
159165

160166

0 commit comments

Comments
 (0)