Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tiles are no longer responsive to input while animated, to avoid acci…

…dental triggering. Close button only becomes active after the tile menu has fully appeared.
  • Loading branch information...
commit ebda2304f3a80562b163b15f6f6b75f2e214da5e 1 parent 6cb275a
@mattgemmell authored
View
BIN  MGTileMenu.xcodeproj/project.xcworkspace/xcuserdata/matt.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
View
11 MGTileMenu/MGTileMenuController.m
@@ -640,7 +640,7 @@ - (CGPoint)displayMenuPage:(NSInteger)pageNum centeredOnPoint:(CGPoint)centerPt
closeCenter.y -= newFrame.origin.y;
_closeButton.center = closeCenter;
_closeButton.hidden = !_closeButtonVisible;
- _closeButton.userInteractionEnabled = _closeButtonVisible;
+ _closeButton.userInteractionEnabled = NO;
// Position tiles.
for (UIButton *tileButton in _tileButtons) {
@@ -820,6 +820,12 @@ - (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)finished
userInfo:nil];
_appeared = YES;
+
+ NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[_closeButton methodSignatureForSelector:@selector(setUserInteractionEnabled:)]];
+ [inv setSelector:@selector(setUserInteractionEnabled:)];
+ [inv setTarget:_closeButton];
+ [inv setArgument:&_closeButtonVisible atIndex:2];
+ [inv performSelector:@selector(invoke) withObject:nil afterDelay:(0.5)];
}
if ([name isEqualToString:MG_ANIMATION_TILES]) {
@@ -959,7 +965,6 @@ - (void)animateTilesForCurrentPage
[tileButton setBackgroundImage:nil forState:UIControlStateHighlighted];
[tileButton setAccessibilityLabel:nil];
[tileButton setAccessibilityHint:nil];
- tileButton.userInteractionEnabled = YES;
tileButton.alpha = 1.0;
[UIView transitionWithView:tileButton
@@ -983,7 +988,6 @@ - (void)animateTilesForCurrentPage
if (_delegate && [_delegate respondsToSelector:@selector(isTileEnabled:inMenu:)]) {
tileEnabled = [_delegate isTileEnabled:currentTileIndex inMenu:self];
}
- tileButton.userInteractionEnabled = tileEnabled;
tileButton.alpha = ((tileEnabled) ? 1.0 : MG_DISABLED_TILE_OPACITY);
if (_appeared) {
@@ -1080,6 +1084,7 @@ - (void)switchToPage:(NSInteger)pageNum
// Begin an appropriate tile-animation.
_pageButton.userInteractionEnabled = NO;
+ [self setAllTilesInteractionEnabled:NO];
if (_animatingTiles) {
_tileAnimationInterrupted = YES;
for (UIButton *tileButton in _tileButtons) {
Please sign in to comment.
Something went wrong with that request. Please try again.