ios – The button does not hide when the button is pressed

I arrive at a problem where I have a button called checkInbtn where I want to hide it when you press a button. But for some reason, the checkInbtn appears when my other button appears. I've tried debugging, and nothing useful comes up. Anyone can help me solve this problem. Thanks for the help.

import UIKit

CheckInViewController class: UIViewController {
@IBOutlet low var checkInbtn: UIButton!
@IBOutlet low var timerLeft: UILabel!
@IBOutlet low checkOutBtn: UIButton!

var seconds = 0
var timer = Timer ()
var isTimerRunning = false

replace func viewDidLoad () {
super.viewDidLoad ()

checkOutBtn.isHidden = true
timerLeft.isHidden = true
}

@IBAction func checkInBtnWasTapped (_ sender: N any) {
runTimer ()

checkOutBtn.isHidden = false
timerLeft.isHidden = false

checkInbtn.isHidden = true
}

@IBAction func checkOutBtnWasTapped (_ sender: N any) {
if timer! = nil {
timer.invalidate ()
}

checkInbtn.isHidden = true
checkOutBtn.isHidden = true
timerLeft.isHidden = true

let alert = UIAlertController (title: "Preview", message: "You have been checked out", preferredStyle: .alert)

alert.addAction (UIAlertAction (title: "OK", style: .default, manager: nil))

self.present (alert, animated: true)
}

func runTimer () {
timer = Timer.scheduledTimer (timeInterval: 1, target: self, selector: (#selector (CheckInViewController.updateTimer))), userInfo: nil, repeats: true
}

@objc func updateTimer () {
seconds + = 1
timerLeft.text = " (seconds)"
}
}