My application uses multiple threads of an NSTimer Object.
As part of a single function (called randomly at random times, rather than a fixed delay), I want it to pause the entire application, suspend threads for only 1 second . I have the following code:
[self performSelector:@selector(subscribe) withObject:self afterDelay:3.0 ];
Which is objective C, and I tried to translate it into Swift as follows:
self.performSelector(Selector:changeColourOfPage(), withObject: self, afterDelay: 1.0)
But I get the error message Missing argument for parameter 'waitUntilDone' in call , and when I insert it, it says that it needs the modes argument, but when I put it, it says Extra argument modes .
I canβt figure out how to pause the application and all its threads for a couple of seconds, and then continue as usual?
Any ideas?
user3834266
source share