I\'m trying to implement heart beat recording functionality in an app i\'m developing.
The preferred method of doing this is by using the iPhone\'s camera with the light
You're trying to do detect a single heart beat "manually", that won't be very robust. I'd say that your best bet is something like a pitch or frequency detection library (the math for detecting the frequency of a color change and for detecting the frequency of a sound has to be identical).
Perhaps something like aubio which I found via this stackoverflow answer to the search "frequency detection" can help you. Otherwise check wikipedia for pitch detection and/or some of the tons of signal processing libraries out there.