How to reference Swift Playground itself?
from How to create a button programmatically? self doesn't work in swift playground : button.addTarget(self, action: "buttonAction:", forControlEvents: UIControlEvents.TouchUpInside) error : Playground execution failed: error: :42:13: error: use of unresolved identifier 'self' I also tried to create a class with buttonAction method inside it compiles but when I click on the button nothing prints in console import UIKit class myself { func buttonAction(sender:UIButton!) { println("Button tapped") } } var s = myself() // Create View var f = CGRect(x:0,y:0,width:200,height:200) var view = UIView