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
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// ...
});
The dispatch_after(_:_:_:)
function takes three parameters:
a delay
a dispatch queue
a block or closure
The dispatch_after(_:_:_:)
function invokes the block or closure on the dispatch queue that is passed to the function after a given delay. Note that the delay is created using the dispatch_time(_:_:)
function. Remember this because we also use this function in Swift.
I recommend to go through the tutorial Raywenderlich Dispatch tutorial