Last active
January 19, 2017 05:38
-
-
Save stremsdoerfer/4e184d9ec10d7f3a7580fe884a955a65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomView:UIView{ | |
var onTap:(()->Void)? | |
... | |
} | |
class ViewController:UIViewController{ | |
let customView = CustomView() | |
var buttonClicked = false | |
func setupCustomView(){ | |
var timesTapped = 0 | |
customView.onTap = { | |
timesTapped += 1 | |
print("button tapped \(timesTapped) times") | |
self.buttonClicked = true | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment