objective-c - button点击触发的pushViewController怎么避免多次弹出控制器?
仅有的幸福
仅有的幸福 2017-05-02 09:20:41
0
4
665

点击button,push到另一个controller,但是有时网络不好,点击了却没有响应,再点击一次,会弹出两次控制器,这种情况应该怎么优雅的处理。

仅有的幸福
仅有的幸福

reply all(4)
世界只因有你

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template