The problem description does not explain the background. If the network request is stuck and the main thread is blocked. Asynchronously put the network request into the concurrent queue, click the button, and execute the push method. Or disable the button after clicking it, and restore the button after the network blocking is completed.
I think you can add a flag and make an if judgment. If the user clicks the flag and sets it to true, the next time it is judged to be true, he will not be able to click, or the click will have no effect.
The best user experience should be to give the user an interaction when touching the button, that is, set a flag to prevent the user from submitting. In addition, try to let the user see the status of the submission, and try again after the final success or failure. Interact with the user to complete the submission operation
The problem description does not explain the background.
If the network request is stuck and the main thread is blocked.
Asynchronously put the network request into the concurrent queue, click the button, and execute the push method.
Or disable the button after clicking it, and restore the button after the network blocking is completed.
I think you can add a flag and make an if judgment. If the user clicks the flag and sets it to true, the next time it is judged to be true, he will not be able to click, or the click will have no effect.
Generally, a HUD is loaded to block the interface and prevent user operations.
The best user experience should be to give the user an interaction when touching the button, that is, set a flag to prevent the user from submitting. In addition, try to let the user see the status of the submission, and try again after the final success or failure. Interact with the user to complete the submission operation