Skip to content

Commit 343ba14

Browse files
Jeff Arenaenriquez
Jeff Arena
authored andcommitted
Disable panning to uncover a nil underController when pan/reveal amounts have been set for that side. Fixes ECSlidingViewController#64.
1 parent 8afea1d commit 343ba14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ - (void)updateTopViewHorizontalCenterWithRecognizer:(UIPanGestureRecognizer *)re
256256
CGFloat panAmount = self.initialTouchPositionX - currentTouchPositionX;
257257
CGFloat newCenterPosition = self.initialHoizontalCenter - panAmount;
258258

259-
if ((newCenterPosition < self.resettedCenter && self.anchorLeftTopViewCenter == NSNotFound) || (newCenterPosition > self.resettedCenter && self.anchorRightTopViewCenter == NSNotFound)) {
259+
if ((newCenterPosition < self.resettedCenter && (self.anchorLeftTopViewCenter == NSNotFound || self.underRightViewController == nil)) ||
260+
(newCenterPosition > self.resettedCenter && (self.anchorRightTopViewCenter == NSNotFound || self.underLeftViewController == nil))) {
260261
newCenterPosition = self.resettedCenter;
261262
}
262263

0 commit comments

Comments
 (0)