Sample code to capture photos or videos on iOS.