jpsim / JPSVolumeButtonHandler

JPSVolumeButtonHandler provides an easy block interface to hardware volume buttons on iOS devices. Perfect for camera apps!
MIT License
336 stars 91 forks source link

Prevent setup observer twice. #42

Closed gliyao closed 7 years ago

gliyao commented 7 years ago

Correct isStarted flag in setupSession and stopHandler method.

In previous version, startHandler and stopHandler need in pairs. The upBlock/downBlock will trigger many times with single volume up event when startHandler execute more than once.

jpsim commented 7 years ago

LGTM, thanks!

apple-ihack-geek commented 7 years ago

@gliyao Am I missing something here? 56: [self startHandler] (with no arguments) doesn't exist, does it ?

apple-ihack-geek commented 7 years ago

Also, you're missing a ; on 67

gliyao commented 7 years ago

@apple-ihack-geek OMG, Thanks. 56: it should be [self startSession] I fix it at #44