As of Swift 2.2, the following code gives the warning:
No method declared with Objective-C selector'sync'
if let tabBarController = segue.destinationViewController as? TabBarController {
tabBarController.navigationItem.rightBarButtonItem =
UIBarButtonItem(title: "Upload",
style: .Plain,
target: tabBarController,
action: "sync")
What should I replace action: "sync"
it with to get rid of the warning?
I've tried:
Selector("sync") // The Xcode provided fix which yields the same warning
#selector(tabBarController.sync()) // Error: Argument of '#selector' does not refer to initializer or method
Selector(tabBarController.sync()) // No error/warning but doesn't fire sync function