I\'ve gone through the iBook from Apple, and couldn\'t find any definition of it:
Can someone explain the structure of dispatch_after
?
d
To execute a funtion or code after a delay use the next method
DispatchQueue.main.asyncAfter(deadline: .now() + 'secondsOfDelay') {
your code here...
}
Example - In this example the funtion getShowMovies
will be executed after 1 second
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
self.getShowMovies()
}