What is the purpose of sleep?
If you do sleep in the main thread, it is not going to update animations in the meantime.
And if you do not call this in the main thread, then it will not work either, because the UIKit animation is not thread safe and can only be reliably used from the main thread.
source share