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

'weak' should not be applied to a property declaration #11

Open
kumapo opened this issue Nov 25, 2018 · 1 comment
Open

'weak' should not be applied to a property declaration #11

kumapo opened this issue Nov 25, 2018 · 1 comment

Comments

@kumapo
Copy link
Owner

kumapo commented Nov 25, 2018

No description provided.

@kumapo
Copy link
Owner Author

kumapo commented Nov 25, 2018

  • https://docs.swift.org/swift-book/LanguageGuide/Protocols.html

    Note that the delegate property is defined as an optional DiceGameDelegate, because a delegate isn’t required in order to play the game. Because it’s of an optional type, the delegate property is automatically set to an initial value of nil. Thereafter, the game instantiator has the option to set the property to a suitable delegate. Because the DiceGameDelegate protocol is class-only, you can declare the delegate to be weak to prevent reference cycles.

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

1 participant