I'm working on a camera app which gives the user the ability to record a video by pressing the volume button.
I'm able to detect when the volume button is pressed with this code :
NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("volumeChanged:"), name: "AVSystemController_SystemVolumeDidChangeNotification", object: nil)
func volumeChanged(notification: NSNotification) {
print(notification);
}
However, I need to know when the volume button is released so I can stop the recording.
Do you know how I could do that ?
Thanks!