我需要每隔4秒调用一次函数
let date = Date().addingTimeInterval(5)
let timer = Timer(fireAt: date,
interval: 0,
target: self,
selector: #selector(runCode),
userInfo: nil,
repeats: false)
RunLoop.main.add(timer, forMode: .common)
这不起作用
我的班级名称是updateDropInAndOut(状态:布尔)
我需要每4秒调用一次updateDropInAndOut(status:true)吗?