From 6e53b372eb38eae9a96797f0e9b91bb7f1b8f743 Mon Sep 17 00:00:00 2001 From: Chris Stamper Date: Thu, 28 Sep 2017 11:47:27 -0400 Subject: [PATCH] Don't accept menu touches when menu is hidden This fixes a rather annoying bug where a collapsed (hidden) menu still accepts touches (it's an edge case that I managed to trigger several times). This might not be the most elegant fix, but I just want to bring it to your attention. --- LGPlusButtonsView/LGPlusButtonsView.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LGPlusButtonsView/LGPlusButtonsView.m b/LGPlusButtonsView/LGPlusButtonsView.m index 2f76fc2..5fb08e9 100644 --- a/LGPlusButtonsView/LGPlusButtonsView.m +++ b/LGPlusButtonsView/LGPlusButtonsView.m @@ -143,7 +143,7 @@ - (instancetype)initWithNumberOfButtons:(NSUInteger)numberOfButtons _contentView = [WrapperView new]; _contentView.backgroundColor = [UIColor clearColor]; - _contentView.userInteractionEnabled = YES; + _contentView.userInteractionEnabled = NO; [self addSubview:_contentView]; _buttonsContentView = [WrapperView new]; @@ -1423,6 +1423,7 @@ - (void)hideAnimated:(BOOL)animated completionHandler:(void(^)())completionHandl - (void)showButtonsAnimated:(BOOL)animated completionHandler:(void(^)())completionHandler { + self.contentView.userInteractionEnabled = YES; if (self.isFirstButtonIsPlusButton) { LGPlusButton *plusButton = _buttonsArray[0]; @@ -1486,6 +1487,7 @@ - (void)showButtonsAnimated:(BOOL)animated completionHandler:(void(^)())completi - (void)hideButtonsAnimated:(BOOL)animated completionHandler:(void(^)())completionHandler { + self.contentView.userInteractionEnabled = NO; if (self.isFirstButtonIsPlusButton) { LGPlusButton *plusButton = _buttonsArray[0];