This differs unexpectedly from the behavior of UIImageView which, when userInteractionEnabled is true, detects hits on the entire frame regardless of transparent pixels. The default behaviour makes e.g. custom buttons tappable in their entire frame as expected.
Being able to detect hits on paths is certainly useful, however, so it might be better to have this as a separate flag (e.g. passThroughEventsOnTransparentRegions or userInteractionExcludesTransparent or something) that defaults to false.
This differs unexpectedly from the behavior of
UIImageViewwhich, whenuserInteractionEnabledistrue, detects hits on the entire frame regardless of transparent pixels. The default behaviour makes e.g. custom buttons tappable in their entire frame as expected.Being able to detect hits on paths is certainly useful, however, so it might be better to have this as a separate flag (e.g.
passThroughEventsOnTransparentRegionsoruserInteractionExcludesTransparentor something) that defaults tofalse.