Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FB12023908: FileRepresentation should accept multiple UTType's #387

Open
sindresorhus opened this issue Mar 1, 2023 · 0 comments
Open

Comments

@sindresorhus
Copy link
Member

  • Date: 2023-03-02
  • Resolution: Open
  • Area: Core Transferable
  • OS: macOS 13.2
  • Type: Suggestion

Description

A common case is for an app to accept multiple content types (UTType). If we take a look at the example in https://developer.apple.com/documentation/coretransferable/filerepresentation, it imports a .mpeg4Movie. However, an app accepting a video will definitely want to accept .quickTimeMovie too. To do this, we need two separate instances of FileRepresentation with identical handling. It would be nice if FileRepresentation accepted multiple content types for when you have identical handling of them.

I’m aware I could abstract the handling out into a helper function which is called in both FileRepresentation, but there’s still some duplicate code and this feels like a common enough case to have some sugar for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant