How to use userInfo parameter in Swift Timers?

userInfo parameter in Timers can be used to send additional information about the context in which the timer is used. The information sent is in the form of dictionary as key-value pair and it can be extracted in the selector method that gets executed once the timer gets fired.

Example code snippet from Playground :

Leave a Reply