Schedule icon indicating copy to clipboard operation
Schedule copied to clipboard

Is it still working ?

Open stavigor opened this issue 2 years ago • 2 comments

The code

let planWorkTimer = Plan.every(.monday, .tuesday, .wednesday, .thursday, .friday).at("6:49 am").do {
            print("planWorkTimer is start")
}

not print.

stavigor avatar Jun 08 '22 16:06 stavigor

me too

kkkkkkkkNight avatar Aug 26 '23 03:08 kkkkkkkkNight

It won't work if you do not have an available RunLoop (see here). You either need to specify a queue like:

let planWorkTimer = Plan.every(.monday, .tuesday, .wednesday, .thursday, .friday).at("6:49 am").do(queue: .global()) {
            print("planWorkTimer is start")
}

Or have a RunLoop:

let planWorkTimer = Plan.every(.monday, .tuesday, .wednesday, .thursday, .friday).at("6:49 am").do {
            print("planWorkTimer is start")
}

CFRunLoopRun()

94794 avatar Jan 26 '24 12:01 94794