What tactic should I use for the following scenari...
# ios
n
What tactic should I use for the following scenario? • I have an existing XCode project that uses XCodegen and a Podfile • I created a KMM project with logic I want to share between JVM and iOS What steps should I take to use my logic in my XCode project? Should I create fat frameworks? An XCFramework? Something else?
l
XCFramework, ideally.
n
Ah then I was on the right track. What would be the best way to reference it in xcode? Do I need to create a podspec file?
l
Nope you don't. Just import it like any other XCFramework. If you don't find where, I think a Google search will quickly give the right hints.
n
Ah yes, it works when adding it to a target's frameworks and libraries, but that of course gets reset when I run pod install 🤔
Is there a way for Podfile to include an XCFramework without having to create a podspec file?
l
I'd search for the issues you have on Google, you're probably not the first who gets stuff reset by Cocoapods.
s
If you’re adding the xcframework to your app’s project and not the cocoapods project, it shouldn’t be getting reset.
n
Hm perhaps I'm confusing some things. If I add my XCFramework to a target's frameworks and libraries and run
xcodegen generate
, then the XCFramework is removed again right?
n
@nhaarman I randomly found this searching around for a different issue, but if you’re using xcodegen you need to define the dependency in the project spec: https://github.com/yonaskolb/XcodeGen/blob/master/Docs/ProjectSpec.md#dependency