简体   繁体   中英

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?

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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM