Compute distance to an object in ios
SureveyorPro lets you do exactly that. It uses the iPhone gyro to calibrate itself. Note that it only lets you measure distances on the surface and support for measuring heights is partial. Also, don't expect any support if you run into problems as it was last updated 2 years ago. 

PS: If  you're looking for something accurate, don't expect it out of an iPhone.