A tripod is very, very useful in situations like this (note, you can get adaptors for mounting iPhones on tripods
, for some reason). Even with a tripod, though, you can have depth of field problems, like this:
To combat this, you need to close the aperture on the camera (the aperture is the hole through which the light travels to hit the "film"). It is one of the things that controls how much light is captured during a shot. The other is shutter speed. The smaller the aperture, the greater the depth of field (the "margin of error" in focus from the main focal point) is. In order to make the aperture smaller, you can two two things:
1) Increase the amount of light.
2) Leave the shutter open longer.
Generally, the latter is easier with cameras that allow you to set such things. The drawback is that longer shutter times make it easier for vibration to blur the image. With a tripod, that is not really a problem. (This is what I should have done when taking the shot above.)
With phone cameras, you probably don't have this kind of control over the device, have to do the former and pour light into the sucker.