Thanks for the answer
My English is not very good, but I will try to explain
Forget the loop and simplify
There are several functions (there may be 2 or more of them) Each function has a time parameter (This is the time in seconds after which the function should start working) I could use sleep, but this does not work for me because the application hangs. Therefore I am using afteAsync (deadline).
Here's a good example of how I'm doing it
let operation = OperationQueue()
operation.maxConcurrentOperationCount = 1
operation.addOperation {
DispatchQueue.main.asyncAfter(deadline: .now() + 10) {
print("1")
}
DispatchQueue.main.asyncAfter(deadline: .now() + 10) {
print("2")
}
DispatchQueue.main.asyncAfter(deadline: .now() + 10) {
print("3")
}
}
in this case, all functions will be executed simultaneously after 10 seconds. And I need them to be executed sequentially with a pause specified in the function parameter
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: