Add a value to the Photos Caption field

In the iOS Photos app there is a caption field the user can write to. How can you write to this value from Swift when creating a photo?

I see apps that do this, but there doesn't seem to be any official way to do this using the Photo library through PHAssetCreationRequest or PHAssetResourceCreationOptions or setting EXIF values, I tried settings a bunch of values there including IPTC values but nothing appears in the caption field in the iOS photos app.

There must be some way to do it since I see other apps setting that value somehow after capturing a photo.

Accepted Answer

It looks like if you set the kCGImagePropertyIPTCCaptionAbstract value in the kCGImagePropertyIPTCDictionary image metadata dictionary the iOS photos app will show that value in the Photos app.

Add a value to the Photos Caption field
 
 
Q