Sharing code between original iOS App and App Extension
ios, ios-app-extension, ios8-extension, xcode
Solution
Nothing should be copied. Just add required files to compile sources for your extension:
Problem
Sharing class between iOS app and extension app I want to use a custom class in both my app and the extension app. If I just have the class in the main app folder, the extension doesn't pick up on it. I tried making a copy of it and putting it into the extension folder, but I of course get a `invalid redeclaration of [my class]` error. What's the best solution for this? It's just one class, not multiple resources.
Related problems
- Library? Static? Dynamic? Or Framework? Project inside another project
- Communicating and persisting data between apps with App Groups
- iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 Beta
- Checking "Allow app extension API only" in iOS framework project exposes internal classes and methods to consumers