gpt4 book ai didi

Swift 4 获取定时定时器的当前时间间隔

转载 作者:行者123 更新时间:2023-11-28 14:56:59 26 4
gpt4 key购买 nike

<分区>

我正在为我的应用程序使用预定计时器,例如:

contentTimer = Timer.scheduledTimer(timeInterval: 30, target: self, selector: #selector(HandleSendContentTime), userInfo: nil, repeats: true)

它运行良好,但我也想在 viewDisappearing 时获取当前 timeInterval

override func viewWillDisappear(_ animated: Bool) {
//do something here with time interval

contentTimer.invalidate()
}

有没有办法在使它失效之前获取当前的 timeInterval 值。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com