Skip to content

Commit 57b9ac6

Browse files
committed
Merge pull request #19 from box/folder-picker-fix-rotation-issues
Fix rotation issues with Folder Picker view controller children
2 parents ff02e4a + 970ce6e commit 57b9ac6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

BoxSDK/FolderPicker/BoxFolderPickerViewController.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ - (void)viewDidLoad
221221

222222
// Content View Controller
223223
[self addChildViewController:self.tableViewPicker];
224-
self.tableViewPicker.view.frame = CGRectMake(0.0, 0.0, self.view.frame.size.width, self.view.frame.size.height);
224+
self.tableViewPicker.view.frame = self.view.bounds;
225225
[self.view addSubview:self.tableViewPicker.view];
226226
[self.tableViewPicker didMoveToParentViewController:self];
227227

@@ -419,6 +419,8 @@ - (void)boxSessionDidBecameAuthenticated:(NSNotification *)notification
419419
{
420420
[self.view endEditing:YES];
421421
[self addChildViewController:self.tableViewPicker];
422+
self.tableViewPicker.view.frame = self.view.bounds;
423+
[self.view addSubview:self.tableViewPicker.view];
422424
[self.authorizationViewController willMoveToParentViewController:nil];
423425

424426
[self transitionFromViewController:self.authorizationViewController
@@ -428,6 +430,7 @@ - (void)boxSessionDidBecameAuthenticated:(NSNotification *)notification
428430
animations:nil
429431
completion:^(BOOL finished)
430432
{
433+
[self.authorizationViewController.view removeFromSuperview];
431434
[self.authorizationViewController removeFromParentViewController];
432435
[self.tableViewPicker didMoveToParentViewController:self];
433436
// do not hold a reference to the authorization view controller. It should
@@ -449,6 +452,7 @@ - (void)boxAuthenticationDidFailed:(NSNotification *)notification
449452
// We only want to do the transition once.
450453
if (self.tableViewPicker.parentViewController) {
451454
[self addChildViewController:self.authorizationViewController];
455+
self.authorizationViewController.view.frame = self.view.bounds;
452456
[self.view addSubview:self.authorizationViewController.view];
453457
[self.tableViewPicker willMoveToParentViewController:nil];
454458

@@ -459,6 +463,7 @@ - (void)boxAuthenticationDidFailed:(NSNotification *)notification
459463
animations:nil
460464
completion:^(BOOL finished)
461465
{
466+
[self.tableViewPicker.view removeFromSuperview];
462467
[self.tableViewPicker removeFromParentViewController];
463468
[self.authorizationViewController didMoveToParentViewController:self];
464469
}];

0 commit comments

Comments
 (0)