SwiftyTimer icon indicating copy to clipboard operation
SwiftyTimer copied to clipboard

NSTimer.new -> NSTimer.init

Open radex opened this issue 9 years ago • 2 comments

Non-scheduling initializers are currently defined as static methods because there was a bug in Foundation causing a crash.

I believe it was fixed, but I don't remember when exactly — it's possible it was only iOS 9/El Capitan, and it still won't work on iOS 8 etc.

If someone could verify this, we could add initializers that are appropriately marked as @available.

PR-s appreciated.

radex avatar Feb 29 '16 17:02 radex

Hm, #22 made this hard :( I can't use initializer syntax if using CFRunLoopTimerCreateWithHandler. So either we'll have to wait for factory initializers (there is a Swift Evolution proposal out there), or… back to NSTimerActor? :(

radex avatar Apr 10 '16 11:04 radex

Nope, still doesn't work. Not sure why — I'd swear I've seen this work... If someone wants to help, check out this branch: https://github.com/radex/SwiftyTimer/tree/init

radex avatar Apr 10 '16 12:04 radex