Skip to content

Instantly share code, notes, and snippets.

@Kdan
Created July 6, 2020 12:07
Show Gist options
  • Select an option

  • Save Kdan/019b3113cccd161ff50890d424b87753 to your computer and use it in GitHub Desktop.

Select an option

Save Kdan/019b3113cccd161ff50890d424b87753 to your computer and use it in GitHub Desktop.
class A {
/// The instance of B we are using to check if we have the answer.
var b: B?
/// A `Bool` indicating if we have the answer to the universe.
private(set) var hasAnswer = false
/// Checks if we have the answer to the universe and updates the `hasAnswer` property.
func checkAnswer() {
hasAnswer = b?.validateAnswer() ?? false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment