ios – Can not set the value of the type 'Bool' to the type 'UIButton? & # 39;

I'm trying to hide a button until another condition is met. When I load the application, I use the slider and when it reaches the maximum, the button should be visible, but for some reason, it will not be the case. I just did it in another application without any problem and the code is almost identical.

I can not find what to do tbh.

redefines func viewWillAppear (_ animated: Bool) {
super.viewWillAppear (animated)

                profileVisible.isHidden = true
}

@IBAction func btnClicked (_ sender: N any)


motionManager.startDeviceMotionUpdates (to: queue) {motion, error) in DispatchQueue.main.async {
self.slider.value = Float ((motion? .attitude.roll ?? 0) * 1.4)

print (self.slider.value)

if self.slider.value == 1,0 {
self.profileVisible = false
self.motionManager.stopDeviceMotionUpdates ()


AudioServicesPlayAlertSound (kSystemSoundID_Vibrate); // vibrate when payment is successful
}

if self.slider.value == -1.0 {
profileVisible = true
self.motionManager.stopDeviceMotionUpdates ()
AudioServicesPlayAlertSound (kSystemSoundID_Vibrate);
}
}
}