Is there a way to have an NSTimer
call a private func
when the timeout has expired?
(Does this even make sense? The NSTimer reference is local to the class, I'm not sure the caller's target at runtime is local, as well.)
Yes, you just need to mark the function @objc
:
@objc private func runner(timer: NSTimer) {
Then it will respond to the selector, but be private to Swift.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With