Skip to content

Instantly share code, notes, and snippets.

@LearnWithTung
Last active March 21, 2021 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LearnWithTung/bff0f5fd5ef6c83f0a1c9a9e79427fc0 to your computer and use it in GitHub Desktop.
Save LearnWithTung/bff0f5fd5ef6c83f0a1c9a9e79427fc0 to your computer and use it in GitHub Desktop.
class ViewControllerA {
var onButtonTappedObserve: (() -> Void)?
...
@IBAction func buttonTapped(_ sender: UIButton) {
onButtonTappedObserve?(// dependencies if any)
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment