swifter-tips / Public-Issues

Public issues for Swifter-tips book

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

延时调用一节拿到函数发返回值取消错误

ripplek opened this issue · comments

//原文是这样的:
let task = delay(5) { print("拨打 110") }
cancel(task)

//应该是这样取消操作的吧
let cancel = dealy(5) { print("拨打110") }
cancel?(true)