-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functions as initializer arguments... #4
Comments
Adding this as a comment, as I'm not sure it's entirely relevant but that might provide some context. What I'm working on here is a Swift package ( This package can then be integrated into any app that needs to regularly poll for updates from a server. I've written this kind of thing what seems like a million times over the years and figure that I should probably just make a generalized Swift package that I can reuse. Basically, the developer using |
Thanks for the report! Does it work if you initialize with a closure rather than a function reference? |
I tested this and it seemed to work fine. While I imagine you'll want to implement this at some point, it does take care of my near-term need to get this working. Thanks! |
I have created a struct that takes a function as an initializer argument. This is then run periodically (using a timer) in order to repeatedly perform some logic on a periodic basis. The timer portion works fine (thanks for that!), but Skip seems to have trouble with the function argument.
A contrived and simplified example, omitting the timer aspect:
For this, Skip errors out with the following during compilation:
On iOS, this code results in the following (correct) output:
The text was updated successfully, but these errors were encountered: