Created
June 15, 2014 21:42
-
-
Save MichMich/1a6ca57561af9f2be20d to your computer and use it in GitHub Desktop.
initializing a property
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 TestView: UIView { | |
let gestureRecognizer : UITapGestureRecognizer | |
init(frame: CGRect) { | |
gestureRecognizer = UITapGestureRecognizer(target: self, action: "tap") //This does not work, It doesn't know self. | |
super.init(frame: frame) | |
} | |
func tap () { | |
println("Tap!") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment