Add Aperture Priority Controls For iPhone 18 Pro
Apple’s September 9 iPhone 18 Pro announcement includes a developer feature worth looking past the product photos for: variable aperture on the main camera, with an API for third-party apps. Apple announced preorders for September 12 and initial availability for September 18. Announcement, ordering, and shipping are different dates.
For a camera app, the interesting question is how to expose that control without hard-coding an “iPhone 18 Pro” branch. The selected camera and active capture format should describe what the UI can offer.
Physical aperture is an exposure control
Aperture priority means choosing a lens aperture while letting automatic exposure manage shutter duration and ISO. It is different from a simulated portrait-blur strength. The iOS 27 API accepts separate values for all three exposure parameters, including constants that leave selected parameters automatic.
A camera can support some combinations and reject others. The useful check is supportsExposureModeCustom(lensAperture:duration:iso:), called on the active format.
That distinction matters when a user switches lenses, changes a recording configuration, or moves between devices. A product name is too coarse to answer whether this particular request is valid now.
Build choices from the active format
The format exposes recommended aperture stops, along with minimum and maximum lens-aperture values. Use the recommended stops as a useful UI starting point and filter them through the exposure-combination check.
These functions belong inside the app’s existing serialized capture owner. Do not call them concurrently with code that changes the device or active format:
import AVFoundation
enum ApertureControlError: Error {
case fixedAperture
case unsupportedCombination
}
@available(iOS 27.0, *)
func availableApertureStops(on device: AVCaptureDevice) -> [Float] {
let format = device.activeFormat
guard format.minLensAperture < format.maxLensAperture else { return [] }
return format.recommendedLensApertureStops.filter { stop in
format.supportsExposureModeCustom(
lensAperture: stop,
duration: AVCaptureDevice.autoExposureDuration,
iso: AVCaptureDevice.autoISO
)
}
}
@available(iOS 27.0, *)
func requestAperturePriority(_ fNumber: Float, on device: AVCaptureDevice) throws {
try device.lockForConfiguration()
defer { device.unlockForConfiguration() }
let format = device.activeFormat
guard format.minLensAperture < format.maxLensAperture else {
throw ApertureControlError.fixedAperture
}
guard fNumber.isFinite,
fNumber >= format.minLensAperture,
fNumber <= format.maxLensAperture,
format.supportsExposureModeCustom(
lensAperture: fNumber,
duration: AVCaptureDevice.autoExposureDuration,
iso: AVCaptureDevice.autoISO
)
else {
throw ApertureControlError.unsupportedCombination
}
device.setExposureModeCustom(
lensAperture: fNumber,
duration: AVCaptureDevice.autoExposureDuration,
iso: AVCaptureDevice.autoISO,
completionHandler: nil
)
}
The query returns an empty set for a fixed-aperture format. That lets the view omit a control that cannot do anything, while still offering the exposure controls the selected camera actually supports.
The apply function checks again after taking the configuration lock. A menu built five seconds ago is not current authority for a camera that has since changed formats. It also rejects nonfinite input before calling an Objective-C API that can raise an exception for unsupported parameters.
There is no suspension while holding the lock. The function submits the request and releases exclusive configuration access promptly.
Requested and applied are different states
The example intentionally passes no completion handler. Its return means the request was submitted; it does not mean the lens physically reached the requested aperture at that instant.
For a control that displays settling or records exact capture metadata, use the setter’s completion information and observed device state. The SDK documents lensAperture as the physical reported position, which may differ slightly from the target value. Label a user’s selection separately from the measured/applied value when that distinction matters.
If rapidly dragging a slider queues several requests, use a revision to keep an older completion from replacing the newest UI state. This is the same ownership issue described in our Duo capture article: camera commands and UI requests can complete on different timelines.
Check the photo-output policy too
The device exposure request is only part of a still-photo pipeline. Apple’s custom-exposure setter documentation describes how photo quality prioritization can affect whether locked settings are preserved during capture.
If your feature promises exact manual exposure, review that contract alongside AVCapturePhotoSettings.photoQualityPrioritization. Choosing speed prioritization has image-quality and stabilization consequences; it should be a deliberate camera-mode decision, not a line copied into every capture request. An automatic high-quality mode and a manual exposure mode may reasonably make different choices.
The sample leaves shutter and ISO automatic. It does not claim to lock every exposure variable or reproduce the system Camera app’s processing.
Verify capability transitions, not just the happy path
On hardware, try the main camera, a fixed-aperture camera, and a format change while the aperture UI is visible. Restore automatic exposure through your capture owner’s normal mode transition, and confirm the UI reflects that state. Test video and still capture separately, including darker scenes where automatic exposure has more work to do.
For unsupported configurations, preserve the last valid capture state and explain the unavailable option. Do not silently change frame rate, HDR, or another camera setting merely to make one aperture choice succeed.
September 27 verification: the example type-checks in Swift 6 mode against the installed iOS 27 SDK in Xcode 27.0. It has not been exercised on an iPhone 18 Pro. The hardware’s announced initial availability was September 18; this review confirms API spelling and availability, not optical behavior.
The new hardware makes aperture control timely, but the implementation should remain capability-driven. Ask the active format what it supports, validate the whole exposure combination, and keep the distinction between a requested setting and a completed capture visible in the design.