DEV Community

Cover image for Building a manual camera app for iPhone: what I learned fighting for exact exposure values
Rosen Alexandrov
Rosen Alexandrov

Posted on AI-assisted

Building a manual camera app for iPhone: what I learned fighting for exact exposure values

I'm a photographer first and a developer second. For years, the thing that bothered me most about shooting on an iPhone was that the built-in Camera app has no manual ISO, and that every photo goes through a processing pipeline you can't switch off. So I built my own camera app, Real ProCam. It's free on the App Store, and version 1.2 just went live.

This isn't a tutorial. It's a list of things that surprised me while trying to keep one simple promise: the ISO, shutter speed and aperture you set are the values in the file.

1. Setting a custom exposure is easy. Keeping it is not.

AVFoundation lets you set a custom exposure with setExposureModeCustom(duration:iso:). Getting the preview to look right takes an afternoon. Getting the photo to carry the same values took me weeks.

The reason is the capture pipeline. Depending on the photo settings, the system may capture and fuse several frames, and the final file can report values that differ from what you set. For a photographer, that breaks the whole point of manual mode. In the end I chose a different path per lens. On the main camera at 1×, the app captures a single RAW frame and develops it itself (I call this PURE), so the values stay exact. On the other lenses, the app uses lighter system processing that keeps your values while cleaning up the smaller sensors.

2. Every camera has its own limits, so read them instead of hardcoding them

The supported ISO range and exposure durations differ per device and per lens, and they change between generations. A hardcoded table for "iPhone 13 and later" was a dead end. Instead, the app reads minISO, maxISO, minExposureDuration and maxExposureDuration from the active format of each camera and builds the 1/3-stop dials from those values. As a bonus, the app automatically offers the full range of whatever hardware it runs on, with no artificial caps.

3. The fastest shutter speeds are quantized by the sensor

This one surprised me. Set 1/32,000 s on the main camera and the file says something else. At very short exposures, the sensor exposes in fixed steps tied to its readout, so the real duration snaps to the nearest step it can actually do. On the main camera I cap the dial at 1/25,000 s on 1× and 1/16,000 s on 2×, because faster settings simply didn't produce faster files. The app also says openly that at those speeds the photo can differ from the setting by up to about 5%, instead of pretending otherwise.

4. SwiftUI view identity can freeze your camera preview

In version 1.2, I made the 16:9 viewfinder fill the height of the screen. The first build had a nasty bug: switching the aspect ratio froze the preview on black for several seconds. The cause was a branching if/else in the layout. Each branch created its own UIViewRepresentable, so SwiftUI tore down the old view and built a new one, attaching a fresh AVCaptureVideoPreviewLayer to a session that was already running.

The fix was a single preview view, created once and kept alive, with only its frame and videoGravity changing between aspect ratios. Switching is now instant.

5. Ask for permissions at the first launch

Another 1.2 lesson: ask for camera and Photos access when the app first opens, not when the user presses the shutter. Otherwise the very first photo someone takes can be lost while the permission dialog is on screen. If access is refused, the app explains clearly that it can't work without it.

What the app does today

  • Manual ISO, shutter speed and aperture (f/1.48 to f/4 on iPhones with a variable-aperture lens), or Auto for any of them
  • PURE mode on the main camera: a single RAW frame developed by the app, with no frame merging, no AI and no filters
  • RAW (DNG), ProRAW, uncompressed TIFF, HEIF and JPEG
  • Every rear lens, plus 8× (200 mm) on iPhone 17 Pro and iPhone 18 Pro
  • Manual focus, white balance presets, exposure compensation, a live histogram and an exposure meter
  • iPhone 13 and later
  • Free, with no ads, no account and no tracking

Try it

If you're into photography or camera APIs, I'd really like your feedback, especially if you've fought AVFoundation's exposure behaviour yourself.

Real ProCam on the App Store: https://apps.apple.com/us/app/real-procam/id6819234474

Top comments (0)