From 007c1f8f22629287c2ee89ed0dfe61c18a07fa9c Mon Sep 17 00:00:00 2001 From: Aleh Dzenisiuk Date: Tue, 31 Oct 2023 18:32:07 +0100 Subject: [PATCH] Make MMMStackContainer pass taps through, just like other containers This is handy when these containers are used within floating headers/footers, where we want to be able to scroll by dragging the header/footer itself, while there still can be other tappable elements, so disabling user interactions for the whole header/footer is not feasible. --- MMMCommonUI.podspec | 2 +- Sources/MMMCommonUIObjC/MMMLayout.m | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/MMMCommonUI.podspec b/MMMCommonUI.podspec index 0cf393e..cd938cb 100644 --- a/MMMCommonUI.podspec +++ b/MMMCommonUI.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |s| s.name = "MMMCommonUI" - s.version = "3.11.0" + s.version = "3.11.1" s.summary = "Small UI-related pieces reused in many components from MMMTemple" s.description = "#{s.summary}." s.homepage = "https://github.com/mediamonks/#{s.name}" diff --git a/Sources/MMMCommonUIObjC/MMMLayout.m b/Sources/MMMCommonUIObjC/MMMLayout.m index b2554f7..e25fd77 100644 --- a/Sources/MMMCommonUIObjC/MMMLayout.m +++ b/Sources/MMMCommonUIObjC/MMMLayout.m @@ -1161,6 +1161,16 @@ - (void)setSubviews:(NSArray *)subviews { } } +// Just like other containers, this should be passing taps through. +- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { + UIView *view = [super hitTest:point withEvent:event]; + if (view == self) { + return nil; + } else { + return view; + } +} + @end //