I have button that show up a modal view but i want that if the user click it he wont be able to use it again for 90 seconds. how can i do this?
相关问题
- How to account for clock offsets in a distributed
- Java Instant.parse on Date java 8
- Linux get system time since power on
- Calculate sum time in Oracle
- Is Sleep() inaccurate?
相关文章
- Get POSIX epoch as system_clock::time_point
- Rails: always include the milliseconds with create
- Will getting the current date/time be thread-safe
- strtotime('today') returning incorrect tim
- Android add image to button
- Format std::time output
- What is the simplest way to find the difference be
- How to get the current UTC time in seconds
Swift 3
I wanted this answer to be much generic so developers find it more helpful
first , is the button hooked as an Outlet or as an action ? in both cases you will need to connect it as an outlet
second, I recommend you using a closure instead of writing a func then calling it you can simply do the following
#Swift 3
Write this code where you want to disable button.
Here buttonTest is the Outlet of that button.
And Write this code anywhere inside of your ViewController
Let me know for any clarification. Thank You.
Swift 4
In the IBAction of the button disable the button and set a timer like this:
And create the func called when the timer ends counting: