How to write dispatch after GCD in iOS swift?

Solution:

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

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift