I've loved the concept from day one. You cover the proximity sensor on the iPhone and it'll start recording 4 seconds of video and then auto-upload it to their servers.
I wondered how difficult it would be to replicate it and it turns out is actually pretty simple. Essentially it comes down to these steps:
- Enable the device's proximity sensor in your app
- Create an observer for the proximity sensor state
AVFoundationto record video when the sensor is covered up
- Do something with the video once it's been recorded utilising
I've managed to crudely replicate it in an hour (I say crudely because it has zero error handling and won't ask for permissions before you record. It works though). Here's what it looks like (the screen goes off during record):
If you want to give it a try, I've uploaded the project to GitHub. You'll need the latest Xcode beta to try it though because Swift 2.0.
These are the two files that do the business: