I’m trying to make some sort of delay in the view controllers changing. I need to be able to hit a button for the next page but also not have it change instantly. that is, somehow give it a timer or delay. Could someone point me in the right direction or give me a little help?
Share
can be used to delay the execution of a method. I’ve heard the sleep() function tossed around too, but it locks up the thread you’re on.
NSTimer also has a helpful convenience method:
In particular, this timer will call the method named “selector” after 2 seconds, and not repeat itself.
EDIT: in your case, you probably want to use
performSelector:withObject:afterDelay:like so:Then within myMethod, perform your delay, which looks like this: