Q:

Action is executing twice on performClick(nil)

I have the problem that my onClick actions are always executed 2 times.  I have the following code:
override func awakeFromNib() {
    NotificationCenter.default.addObserver(
        self,
        selector: #selector(self.pressStartbutton),
        name: NSNotification. Name(rawValue: "Startbutton"),
        object: nil)
}

@objc private func pressStartbutton(notification: NSNotification){
    start_button.isEnabled=true
    start_button.performClick(nil)
}

Each time the "pressStartbutton" function is executed, the action always runs 2 times in a row.  How should the code look so that it executes it only once? 

A:

Ok solved the Problem.  I put the NotificationCenter Part into "viewDidLoad" instead of "awakeFromNib".  Now the function is executed once.