Skip to content
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

Why dont support dispatch_once? #48

Closed
huynhphan89 opened this issue Sep 17, 2015 · 2 comments
Closed

Why dont support dispatch_once? #48

huynhphan89 opened this issue Sep 17, 2015 · 2 comments

Comments

@huynhphan89
Copy link

Hi,

You said "I've found no need for dispatch_once in Swift" in #2 .
Could you please explain why no need to use dispatch_one in Swift?

Thanks.

@josephlord
Copy link

Global variable (and constants) plus static members of classes/structs/enums with inital values basically initialised with the same dispatch once guarantees. And you can let the inital value be the result of a closure if you need any complex set up.

@duemunk
Copy link
Owner

duemunk commented Sep 18, 2015

@huynhphan89 What @josephlord said. If you have a specific use of dispatch_once in Swift, feel free to share :)

@duemunk duemunk closed this as completed Sep 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants