I want to call a method at the same time every day (at the end of the day, like 23.59). I understand to set a repeating method to be called I do like this:
let date = Date()
let timer = Timer(fireAt: date, interval: 86400, target: self, selector:
#selector(runCode), userInfo: nil, repeats: true)
RunLoop.main.add(timer, forMode: RunLoopMode.commonModes)
This repeats every 86400 seconds, which mean every day. But how to set the date parameter to start at 23.59, the specific time I want. Currently, it just goes off at the time the code calls it.
Thanks very much