I have button and method
switchViewButton = UIButton.buttonWithType(.System) as? UIButton
switchViewButton!.frame = CGRectMake(15, 25, 50, 50)
switchViewButton!.setTitle("sss", forState: .Normal)
switchViewButton!.addTarget(self, action: "switchViewFunc", forControlEvents: .TouchUpInside)
switchViewButton!.backgroundColor = UIColor.redColor()
switchViewButton!.layer.cornerRadius = 25
topView.addSubview(switchViewButton)
@IBAction func switchViewFunc(sender : AnyObject){
println("Button was clicked", sender)}
This method crashes app with reason "unrecognized selector sent to instance"
I have another button and method just like this, and it's work perfect. If I'm delete (sender : AnyObject)
it works. I cann't understand what is wrong