CooperRS / RMStepsController

This is an iOS control for guiding users through a process step-by-step
MIT License
1.04k stars 119 forks source link

'cancelButton' not working under iOS 11 #50

Open tarekskr opened 7 years ago

tarekskr commented 7 years ago

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.

CooperRS commented 7 years ago

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

tarekskr commented 7 years ago

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

CooperRS commented 7 years ago

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?

tarekskr commented 7 years ago

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

iMark21 commented 7 years ago

Can you update the POD?

tarekskr commented 7 years ago

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

CooperRS commented 7 years ago

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 🙂

tarekskr commented 7 years ago

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 😊