---
title: Structuring Your Code to Support App Extensions
framework: sirikit
role: article
role_heading: Article
path: sirikit/structuring-your-code-to-support-app-extensions
---

# Structuring Your Code to Support App Extensions

Move your back-end services to a private framework so your app and app extensions can use them.

## Overview

Overview An app extension is an agent that acts on behalf of your app, vending services or providing information to the system when asked. Because they extend your app’s behavior, app extensions often need access to the same back-end services and data that your app uses. Lightweight extensions that don’t include most of your app’s code can respond to a user’s request more quickly. Long-running tasks like playing music or tracking a workout need to happen in your app. If necessary, you can resolve the parameters of an intent in an extension, then instruct SiriKit to launch your app for the final handling step. If your app and app extension share services, consider structuring your code in the following way: Implement your core services in a private shared framework. A private shared framework lets you place the code for accessing your services in one code module and use that code from multiple targets. Shared frameworks minimize the size of both executables and make testing easier by ensuring that each executable uses the same code path. Use a shared container to store common resources. Put relevant images and data files into a shared container so your app and app extension can use them. You enable shared container support in the Capabilities tab of each target.

## See Also

### Articles

- [Adding User Interactivity with Siri Shortcuts and the Shortcuts App](sirikit/adding-user-interactivity-with-siri-shortcuts-and-the-shortcuts-app.md)
- [Defining Relevant Shortcuts for the Siri Watch Face](sirikit/defining-relevant-shortcuts-for-the-siri-watch-face.md)
- [Deleting Donated Shortcuts](sirikit/deleting-donated-shortcuts.md)
- [Dispatching intents to handlers](sirikit/dispatching-intents-to-handlers.md)
- [Improving Siri Media Interactions and App Selection](sirikit/improving-siri-media-interactions-and-app-selection.md)
- [Improving interactions between Siri and your messaging app](sirikit/improving-interactions-between-siri-and-your-messaging-app.md)
- [Registering Custom Vocabulary with SiriKit](sirikit/registering-custom-vocabulary-with-sirikit.md)
- [Confirming the Details of an Intent](sirikit/confirming-the-details-of-an-intent.md)
- [Handling an Intent](sirikit/handling-an-intent.md)
- [Resolving the Parameters of an Intent](sirikit/resolving-the-parameters-of-an-intent.md)
- [Generating a List of Ride Options](sirikit/generating-a-list-of-ride-options.md)
- [Handling the Ride-Booking Intents](sirikit/handling-the-ride-booking-intents.md)
- [Donating Reservations](sirikit/donating-reservations.md)
- [Specifying Synonyms for Your App Name](sirikit/specifying-synonyms-for-your-app-name.md)
- [Intent Phrases](sirikit/intent-phrases.md)
