title: What means this: "Thread 1: "-[First_App.ProximitySensorViewController proximityChanged:]: unrecognized selector sent to instance 0x14d707940""
body: <p>Hey I'm trying to use the proximity sensor to increase a value, but when I start the function, it crash's. This is my Code, can someone help me?</p>
  <pre><code>func proximityChanged(notification: NSNotification) {
              let device = notification.object as? UIDevice
              if device?.proximityState == true {
                  print(&quot;\(device) detected!&quot;)
                  count += 1
                  updateCountLabel()
              } else {
                  print(&quot;Error&quot;)
              }
          }
          
          
          func activateProximitySensor() {
              let device = UIDevice.current
              device.isProximityMonitoringEnabled = true
              if device.isProximityMonitoringEnabled {
                  NotificationCenter.default.addObserver(self, selector: Selector((&quot;proximityChanged:&quot;)), name: NSNotification.Name(rawValue: &quot;UIDeviceProximityStateDidChangeNotification&quot;), object: device)
                  
              }
          }
  </code></pre>