0

enter image description here

Here is my page structure. Tap Gesture recognizer is attached to ContainerView. Done button has its own click handler.

Container View is fullscreen. Toolbar takes small space over Container View.

With Xcode 8 everything works fine. With Xcode 9, when I click on Done, it calls TapGesture's event instead. Changing cancelsTouchesInView of tapGesture doesn't matter. I would expect to have fired both handlers with cancelsTouchesInView to NO, but it just calls just TapGesture's handler. Even despite of the fact that the button looks like it is clicked.

The only way I can make that works is to disable/remove tap gesture.

Is that Apple's issue or there are some changes in Xcode 9 that I don't know about?

Stas Ivanov
  • 917
  • 1
  • 10
  • 22
  • 1
    It is my understanding that `UIGestureRecognizer` delegates will always be called for subviews and has always been like that. To eliminate them from your subviews see [this](https://stackoverflow.com/a/38217199/5153744) answer. – NSGangster Oct 18 '17 at 17:13
  • First time hearing this... It was working fine for a long time. If you click on button which is subview, it didn't call delegate method, instead it called only button action handler. And the problem here is not that it doesn't call TapGesture's handler. The problem is that it doesn't call button's handler, which works fine on iOS 8/9/10/11 built with Xcode 8, but doesn't with Xcode 9 – Stas Ivanov Oct 18 '17 at 18:04
  • 1
    If you implement the answer I linked in my previous comment, it should ignore the tap gesture recognizer and instead call the button's. It was likely a bug in Xcode 8 that was allowing it to work that got fixed in Xcode 9. Also check iOS versions you may be testing now on latest iOS and it was previous iOS versions that allowed it to work before. – NSGangster Oct 18 '17 at 18:12
  • @NSGangster, thanks, it really looks like a bug in iOS SDK under 11. – Stas Ivanov Oct 19 '17 at 07:42

0 Answers0