How to set the action for a UIBarButtonItem in Swift
As of Swift 2.2, there is a special syntax for compiler-time checked selectors. It uses the syntax: #selector(methodName). Swift 3 and later: var b = UIBarButtonItem( title: “Continue”, style: .plain, target: self, action: #selector(sayHello(sender:)) ) func sayHello(sender: UIBarButtonItem) { } If you are unsure what the method name should look like, there is a special … Read more