ibuildinpublic
Log inStart free
ibuildinpublic
Log inStart free
BuilderProductExperiences5Posts5

iOS share sheet

How to/GuideNov 6, 2026
Ehsan Azish

by Ehsan Azish

@ehsanazish80Lvl 5·Builder

An iOS share sheet can open successfully and still fail to share the file.
I hit this while testing an export flow this week.
The app created a temporary file. The share sheet appeared normally. The receiving app started importing it—and then the file disappeared before the read finished.
Nothing was wrong with the share sheet. The file lifetime was wrong.
My first implementation created the export too close to presentation, so the object keeping it alive could disappear while another app was still reading.
The corrected flow is:
Prepare the export
Retain its URL in state
Present the share sheet
Let the receiving app finish
Remove the file after dismissal
This is an easy bug to miss because the UI works. You tap Share, the system sheet opens, and everything looks finished.
But presenting the destination is not the same as completing the transfer.
Temporary files should live for the whole operation, not merely long enough to start it.
A useful reminder from shipping: when a system API hands work to another process, your resource lifetime must follow the consumer—not your own screen.

3likes1comments9Impressions
1Bookmark
Sign in to interact
Sign in to reply

1 reply

Mark Rosario
Mark Rosario@markrosarioLvl 7·Active Builder·11h
That is a nasty failure mode — everything looks right until the receiving app's read races the temp file disappearing. Your corrected flow is the part worth remembering: the file has to live for the whole operation, not merely long enough to start it.
commentslikes