Skip to content

Instantly share code, notes, and snippets.

@llinardos
Last active November 5, 2017 23:41
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 llinardos/79bd4ff54faae2b70f15b8021b04c256 to your computer and use it in GitHub Desktop.
Save llinardos/79bd4ff54faae2b70f15b8021b04c256 to your computer and use it in GitHub Desktop.
class Tap {
private static var instances: [Tap] = []
// ...
static func on(view: UIView, fires action: @escaping () -> Void) {
let tap = Tap(view: view, action: action)
Tap.instances.append(tap)
}
private init(view: UIView, action: @escaping () -> Void) { /* ... */ }
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment