How to write dispatch after GCD in iOS swift?
Solution:
Using GCD below are the three methods after few milliseconds or microseconds or nanoseconds.
Using GCD below are the three methods after few milliseconds or microseconds or nanoseconds.
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(500)) {
print("after milliseconds")
}
DispatchQueue.main.asyncAfter(deadline: .now() + .microseconds(1000)) {
print("after microseconds")
}
DispatchQueue.main.asyncAfter(deadline: .now() + .nanoseconds(10000000)) {
print("after nano seconds")
}
Comments
Post a Comment