RMStepsController icon indicating copy to clipboard operation
RMStepsController copied to clipboard

'cancelButton' not working under iOS 11

Open tarekskr opened this issue 7 years ago • 8 comments

RMStepsBar.cancelButton does not seem to be receiving touch events under iOS 11. Has anyone else faced this issue?

iOS 9 and 10 are working perfectly.

tarekskr avatar Sep 25 '17 01:09 tarekskr

Just checked an I can confirm the issue. I'll have a look asap and let you know 🙂

CooperRS avatar Sep 25 '17 08:09 CooperRS

Thank you so much! 🙂 I tried looking at the code but had no clue as to why this happens.

tarekskr avatar Sep 25 '17 14:09 tarekskr

Well the problem is that the UIToolbar of iOS 11 adds some new subviews to itself. Since RMStepsBar (the bar containing the steps) inherits from UIToolbar these new subviews have been added above the view from RMStepsBar and thus receive all touch events.

I created a little branch called ios-11 which contains a fix for the problem. Mainly RMStepsBar does not inherit from UIToolbar anymore (that inheritance was a bad idea anyways 😄). Could you take a look if this branch suits your needs?

CooperRS avatar Sep 25 '17 19:09 CooperRS

This fixes the cancel button issue, but tapping the other steps on the bar doesn't work anymore 🙂

tarekskr avatar Sep 26 '17 04:09 tarekskr

Can you update the POD?

iMark21 avatar Oct 02 '17 20:10 iMark21

Hi Cooper, any luck? I can also try to fix it if you give me a hint where to look. Thanks!

tarekskr avatar Oct 10 '17 00:10 tarekskr

Hey!

Sry I did not find the time to take care of it. I will as soon as possible. Hopefully next weekend 😄.

In the meantime: If you want you can take a look at RMStepsBar. The bug should be somewhere there. Probably the tap gesture recognizer has a wrong target 🙂

CooperRS avatar Oct 16 '17 19:10 CooperRS

Thank you so much for the tip. I checked it out, and it seems to be caused by this 'if' statement inside the 'recognizeTap:' method:

if(index < self.indexOfSelectedStep && self.allowBackward) { [self.delegate stepsBar:self shouldSelectStepAtIndex:index]; }

This will always be false if you're tapping a forward tab. Hope this helps 😊

tarekskr avatar Oct 16 '17 23:10 tarekskr