Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how app extension can access the containing app images/assets/resource data

I implemented the document provider app extension feature with my own ios app. The problem is the app extension was not able to access the containing app images/assets or the containing apps resource data. Does any one knows how to achieve it?.

like image 621
loganathan Avatar asked Feb 13 '23 02:02

loganathan


1 Answers

The extension has its own target in your Xcode project. In order to access resources in the extension you also need to add them to that target (in the File Inspector also check your extension target in the Target Membership section). Just be aware that those resources also get copied into the extension bundle, which increases your overall app size.

Sidenote: In my extension I didn't add my default image asset catalogue (Images.xcassets) to the extension, but was still able to access the containing images. Maybe that's an exception.

like image 146
Frank Schlegel Avatar answered Feb 15 '23 11:02

Frank Schlegel