Wordpress-ios: SIWA: Continue with Apple button responds to touch incorrectly

Created on 31 Aug 2019  ·  9Comments  ·  Source: wordpress-mobile/WordPress-iOS

I’ve noticed Continue with WordPress.com and Continue with Google are listening to onTouchUp, whereas Continue with Apple reacts to onTouchDown.

Reported p77Llu-czj-p2/#comment-14613 by @jleandroperez.

Sign In With Apple [Pri] Low [Type] Tech Debt

All 9 comments

Just to note, when I implemented the button it would only respond to onTouchDown. So, it wasn't by choice but by necessity. I'll take another look to see if we can use the desired touch at some point.

@ScoutHarris potentially fixed recently! We've got it working in a Simplenote WIP branch here.

let siwaButton = ASAuthorizationAppleIDButton(authorizationButtonType: .continue, authorizationButtonStyle: .black)
siwaButton.addTarget(self, action: #selector(aaplLoginWasPressed), for: .touchUpInside)

(Tested with Xcode11 Beta5, updating to B7 as of now!)

Ah, cool! Thanks @jleandroperez !

Hrm. Interestingly touchUpInside still doesn't work. It does for the other buttons in the button view, so I'm not sure what's going on. I'll look at it again later...

@ScoutHarris just double checked, and it's working in Simplenote / Xcode beta 7. Not sure what might be going on, but something is interfering along the way, most likely!

@astralbodies @jleandroperez - OK, I've banged my head enough. Does anyone have an objection to moving this to groundskeeping? Maybe someone smarter than me can figure it out...

(@jleandroperez - I prematurely stated the issue was due to resizing the apple button. I was mistaken.)

@ScoutHarris I've spent some time yesterday debugging this one. PURE curiosity.

  1. Nope, the target instance does not get deallocated. Is alive and well
  2. Yes. isUserInteractionEnabled is set to true
  3. No, there are no overlapping views
  4. No, switching @obc to @IBAction in the callback signature doesn't change a thing
  5. No, It doesn't matter the position in which the button lies within the container stackView

Furthermore: I've hacked, real quick, the SIWA button in NotificationsViewController, with the exact same code the Authenticator has. The result? touchUpInside works perfectly.

The next step in this... wild hunt, would have been: subclass the SIWA button, override all of the touch primitives, and debug to the last bit what's going on.

I'm pretty sure this is an SDK bug. Something in the authenticator hierarchy breaks the responder chain, for that particular event.

Absolutely fine on my side to tag this as groundskeeping!!! thank you Steph!!!

Hey @jleandroperez .

Well, you just documented pretty much what I tried as well. I was going to do that before I moved it to groundskeeping. Sorry, I didn't think to put it all down yesterday. I should have known you'd try. 😄

I'm pretty sure this is an SDK bug.

Dang it! I googled several times and never saw anything. Clearly I didn't in the past week though. Thanks for that.

Thank you for your time!

I still experience this bug in my own project with Xcode 11.2. Confounding.

Was this page helpful?
0 / 5 - 0 ratings