Skip to content

Commit

Permalink
FileRepresentation blog: Add paragraph about workaround limitations
Browse files Browse the repository at this point in the history
  • Loading branch information
mac-cain13 committed Dec 8, 2023
1 parent 6eb1db1 commit 0ec546c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Since video files can become quite big we don't want to keep the data in memory.

## The issue

However when we started to drop the file on Finder or other apps like Slack nothing happened. They just didn't accept the content. It turns out in macOS 13 and 14 `FileRepresentation` isn't working correctly. No matter the declared content type, whether the file should be opened in place or if origional file access is allowed. The file is simply never accepted.
However when we started to drop the file on Finder or other apps like Slack nothing happened. They just didn't accept the content. It turns out in macOS 13 and 14 `FileRepresentation` isn't working correctly. No matter the declared content type, whether the file should be opened in place or if original file access is allowed. The file is simply never accepted.

## Workaround

Expand All @@ -49,6 +49,8 @@ Turns out there is a workaround; If you also declare a `ProxyRepresentable` that
}
```

Please note that falling back to `ProxyRepresentation` only works for files that are already on disk. It's not allowed to perform long-running work in exporting and importing closures according to the documentation. If you take too much time the app stalls and shows a beachball. Additionally the other app will gain access to the original file and not a copy, so that also is something to keep in mind.

This was a pretty confusing issue and workaround, since the WWDC talk explicitly notes that `FileRepresentation` should be used for sharing files. The `ProxyRepresentation` with an `URL` should be used if you want to share an URL to a website for example. It seems this behaviour isn't working correctly at this moment.

## Feedback Assistant & Sample project
Expand Down

0 comments on commit 0ec546c

Please sign in to comment.