Spot the bug in this UIView subclass. Bonus points if you know what happens and why this actually works most of the time. I’ll post the answer later today.

To clarify the scope: it’s directly inside the subclass so pageControl is a property.

10 hours later: What happens:

  1. self is valid… but weird (curried?)
  2. The target param is typed Any? so self is OK.
  3. The target is set as NSNull somehow.
  4. This is a nil-targeted action (traverses the responder chain). My view is usually on the responder chain so still receives the action.