I have a UIButton
at he bottom of a chat screen. I use TouchDown
to detect that the user started holding the button and start audio recording (standard messenger app functionality).
The problem is that when the button is at the bottom of the screen, there is a 1s lag from the moment I start to hold the button to the moment TouchDown
fires.
When the keyboard is displayed and the bottom moves up the screen, there is no lag at all.
I found a similar question, iOS - Delayed "Touch Down" event for UIButton in UITableViewCell but the button is not in a table view or scrollview
Overriding the touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
method of the button and just printing the events shows that it also has the same lag.
This makes me think that the lag is related to the button position at the bottom of the screen.