Is it possible to include source code from an app extension in a framework?

If I have an XCode project that generates a framework when built, then I've noticed that its possible to add new additional targets to the project of type app extension.

However if I add some source code to an app extension and regenerate the framework, then that source code is not accessable from the resulting framework (i.e. if the framework is included into an app, then the app code doesn't have visibility of the code that was added to the extension in the framework).

Is this something which is possible to achieve? Ideally I would like to package the main source code that constitutes the framework content, along with the source code for a few extensions into a single framework, so that the app(s) that use the framework can include the framework into their main app target and also include it in the app extension target.

I noticed that if the scheme of the framework is changed to the extension before building, then the result is not a .framework file but a .appex file. For client apps of the framework, can they directly include/use that .appex file? If so how can that be achieved? Does

You can add the shared code into a framework target and remove it from any other targets in the app.

For the app target, configure your Xcode project to link and embed the framework using the General tab of the app target.

For the app extension target, go to the General tab and add the framework to the appropriate list in that tab, but make sure that it is not embedded. The default configuration of targets in Xcode includes search paths to find the framework within the app bundle, so when the app extension looks for the framework, it will find the copy that you're embedding via the app target.

— Ed Ford,  DTS Engineer

Is it possible to include source code from an app extension in a framework?
 
 
Q