Check out example codes for "swift + time delay call main thread". It will help you in understanding the concepts better.

Code Example 1

DispatchQueue.main.asyncAfter(deadline: .now() + 1) { 
   //Your code
}

Learn ReactJs, React Native from akashmittal.com