@selector() in Swift?
I'm trying to create an NSTimer
in Swift
but I'm having some trouble.
NSTimer(timeInterval: 1, target: self, selector: test(), userInfo: nil, repeats: true)
test()
is a function in the same class.
I get an error in the editor:
Could not find an overload for 'init' that accepts the supplied arguments
When I change selector: test()
to selector: nil
the error disappears.
I've tried:
selector: test()
selector: test
selector: Selector(test())
But nothing works and I can't find a solution in the references.