Skip to content

Commit

Permalink
fix rotation resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelochs committed Oct 18, 2016
1 parent 01ec688 commit 92b2496
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ViewDeck/Private/IIViewDeckTransition.mm
Expand Up @@ -46,6 +46,8 @@ @interface IIViewDeckTransition () {

@property (nonatomic) id<IIViewDeckTransitionAnimator> animator;

@property (nonatomic) IIViewDeckSide openSide;

@end


Expand All @@ -70,6 +72,8 @@ - (instancetype)initWithViewDeckController:(IIViewDeckController *)viewDeckContr
_finalCenterFrame = [layoutSupport frameForSide:IIViewDeckSideNone openSide:toSide];

IIViewDeckSide side = (IIViewDeckSide)(fromSide | toSide);
_openSide = side;

_sideViewController = (side == IIViewDeckSideLeft ? viewDeckController.leftViewController : viewDeckController.rightViewController);
_sideView = _sideViewController.view;
_initialSideFrame = [layoutSupport frameForSide:side openSide:fromSide];
Expand Down Expand Up @@ -129,6 +133,15 @@ - (void)prepareControllerAndViewHierarchy:(BOOL)animated {
[containerView addSubview:decorationView];

[self.sideViewController beginAppearanceTransition:YES animated:animated];

UIViewAutoresizing autoresizingMask = UIViewAutoresizingFlexibleHeight;
if (self.openSide == IIViewDeckSideLeft) {
autoresizingMask |= UIViewAutoresizingFlexibleRightMargin;
} else {
autoresizingMask |= UIViewAutoresizingFlexibleLeftMargin;
}
self.sideView.autoresizingMask = autoresizingMask;

// add the view AFTER `beginAppearanceTransition:animated:`, otherwise adding the view generates appearance calls itself which results in 'Unbalanced calls to begin/end appearance transitions' warnings
[containerView addSubview:self.sideView];
} else {
Expand Down

0 comments on commit 92b2496

Please sign in to comment.