I want to display a "Network Error" message if after 10 seconds of trying to connect, a login does not succeed.
How can I stop my login function after 10 seconds and show this error message?
I'm using AlamoFire.
I don't have the full implementation, but this is the skeleton of what I want my function to behave like:
func loginFunc() {
/*Start 10 second timer, if in 10 seconds
loginFunc() is still running, break and show NetworkError*/
<authentication code here>
}