When moving a button action into the View coding screen, CRTL + click and drag the button BELOW the “viewDidLoad” { bracketed } area.
In many cases, Touch Up Inside is the best response for this, especially when it’s a basic button response.
This also gives the button action a name for the code to find and use.