0

There is a Swift project on GitHub that I want to include in my iOS app.

In my iOS app, I use Carthage. But the GitHub project is not compatible with Carthage (only with Cocoapods), so I need to include the .framework file in my project manually.

How can I generate the .framework file without Carthage?

2 Answers2

0

Building the framework is not always the same across projects. That being said, there should be a target available when you open the project to make the framework build. It should look something like this.

enter image description here

After clicking run the framework is usually output to the products directory.

enter image description here

If this doesn't work for you with this project then maybe you could share a link to the github page for the project and I could provide more instruction.

Nordeast
  • 1,353
  • 13
  • 21
  • what if you only have a .framework and no .xcodeproj? – SRMR Nov 04 '17 at 00:53
  • Not sure I know what you mean @SRMR. If you already have the .framework then you already have the code and you can include it in your project by dragging it in to Xcode. The .framework file is actually a directory that contains all of the compiled code of an external library. – Nordeast Nov 05 '17 at 02:59
  • Sure, let me try from a different angle: If I sent you a .framework by itself (where scheme might or might not have been shared), would you be able to turn that into a library or framework you could build on your own and share a scheme for? – SRMR Nov 05 '17 at 16:08
  • The .framework contains the source code compiled into binary so its not possible to rebuild the framework into swift/objc code very easily. I don't think it would be possible to edit the scheme for a particular framework unless you were able to convert it back into that swift/objc source code. You can see this question for more info [here](https://stackoverflow.com/questions/35061626/how-to-decompile-framework-file-in-ios-to-get-source-code). – Nordeast Nov 06 '17 at 15:54
  • 1
    That makes sense now, thanks for explaining all of that to me! – SRMR Nov 06 '17 at 19:20
0
  1. Fork Project
  2. Change scheme to shared in scheme management (more information on Carthage docs)
  3. Add your fork to your Cartfile

You can stop here but I highly recommend do this after:

  1. Update README with information about Carthage support
  2. Make a pull request
Jakub
  • 13,712
  • 17
  • 82
  • 139