Developers / Extensions

Extensions

Action Extensions

With action extensions on iOS and iPadOS, developers can offer some of their app’s functionality in a contextual, highly focused way. Action extensions allow users to view or manipulate their content with your app’s code through quick interactions, and they’re a great way to avoid unnecessary app switching and duplication of data.

App extensions volunteer their services based on the content being offered by the user using either of iOS/iPadOS’ two primary sharing interfaces: UIActivityViewController or UIDocumentInteractionController. If your app extension supports that type of content, the system provides you with a copy and forScore is not involved in the process any further. Any changes you make will not be reflected within forScore and can only be stored within (or shared from) your app.

In-Place EditingforScore 10.4

As of version 10.4, forScore supports in-place modifications of a user’s content with certain limits, allowing them to modify their files in ways forScore doesn’t support. This may include editing a PDF file’s table of contents, updating a CSV index’s values to fix errors, or trimming silence from the beginning of an audio file.

If a user selects a supported file* and invokes your extension, and if your extension returns modified data as a single NSItemProvider that can provide the same file type as the original content, forScore will adopt those changes with the user’s consent. The first time an extension returns data to forScore in this manner the user is alerted and can choose to either trust that extension, allowing it to modify their content going forward, or they can choose to ignore any edits made using that specific extension.

We want to encourage this kind of interoperability, and while we think the method described above offers the kind of flexibility required in most cases, your extension may need to work differently. If you have or are creating an extension that you think could serve our users well and that returns modified content in a different way, let us know and we’ll see if we can include support with a future update.

*forScore supports a number of different file types, but not all are suitable for in-place editing. Learn more about forScore’s file types here.

Examples

Returning Modified Content

NSItemProvider *itemProvider = [[NSItemProvider alloc] initWithContentsOfURL:fileURL];
NSExtensionItem *extensionItem = [[NSExtensionItem alloc] init];
extensionItem.attachments = @[itemProvider];
[self.extensionContext completeRequestReturningItems:@[extensionItem] completionHandler:nil];