没有输入参数的完成处理程序
func sampleWithCompletion(completion:@escaping (()-> ())){
let delayInSeconds = 1.0
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + delayInSeconds) {
completion()
}
}
//Call the function
sampleWithCompletion {
print("after one second")
}