I don't seem to be able to remove local class functions from each of my classes because I can't figure out how to use #selector to call a function that's in another class (when Self is a required parameter).
Presently I call a local function which calls out just fine:
class Tickets: UIViewController {
override func viewWillAppear(_ animated: Bool) {
NotificationCenter.default.addObserver(self, selector: #selector(setDataIcon), name: NSNotification.Name(rawValue: "ActiveSyncRequestInitiated"), object: nil)
}
@objc func setDataIcon() {
global.setDataIcon(self) // called via #selector above, works
}
}
I'd rather remove the local function setDataIcon and call via selector as
#selector(global.setDataIcon(self)) // doesn't compile!
But I get error "Argument of '#selector' does not refer to an '@objc' method, property, or initializer"