I need to add delay between the execution of two lines in a(same) function. Is there is any favorable options to do this?
Note: I don\'t need two di
You can use the NSThread method:
NSThread
[NSThread sleepForTimeInterval: delay];
However, if you do this on the main thread you'll block the app, so only do this on a background thread.
or in Swift
NSThread.sleepForTimeInterval(delay)
in Swift 3
Thread.sleep(forTimeInterval: delay)