Search code examples
iosswiftclassimessage-extension

How to share a class between app and it extension?


I'm creating a message extension for my app. To share data between my targets, I use App Group.

In my main app, I have a class IAPHelper, to manage in-app purchases. Now I need to use this class in my message extension WITHOUT creating the class again.

How can I do?


Solution

  • Select the class and in your Xcode Utilities you can select your Target Membership:

    enter image description here