title: Cannot assign value of type 'Bool' to type 'UIButton?'
body: <p>I am trying to hide a button, until another condition is met. When i load the app i am using the slider and when it reaches the max, it should make the button visible, but for some weird reason it won't. I have just done it in another app with no issues and the code is almost identical.? </p>
  
  <p>Can't figure out what to do tbh. </p>
  
  <pre><code>override func viewWillAppear(_ animated: Bool) {
      super.viewWillAppear(animated) 
      profileVisible.isHidden = true
  }
  
  @IBAction func btnClicked(_ sender: 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); // vibrates when payment has succeded
          }
  
          if self.slider.value == -1.0 {
             profileVisible = true
              self.motionManager.stopDeviceMotionUpdates()
              AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
          }
      }
   }
  </code></pre>