2

I want to build a custom framework in pure swift. Then I want to export that custom framework and import it into another pure swift app project. I want to do this by linking to the framework in the "Link binary with libraries" build phase. Seems straightforward but I never get it working in this particular approach.

I have googled for solutions and tried out some things. However I don't want objective-c interoperability. It's all pure swift anyway. Also I don't want to create an app project and then add embed a framework in to that (what is the point of this anyway?). Neither do I want to reference the framework project (by dragging the framework project into the app project). And I certainly don't want to create a workspace. All the solutions I found fall into one of these categories.

Every framework and every app I work on should be contained to its own little project universe.

Thus far I am stuck at the errors "no such module" and "linker command failed with exit code 1". A link with step by step instructions would be appreciated or any other advice you might have pertaining to this issue.

user965972
  • 2,489
  • 2
  • 23
  • 39
  • 1
    You can use the command line link your app to the framework. There's *a lot* to cover but it is doable. Xcode can do it for you, and it requires that you do it in a certain way, but you didn't want that. For examples, so this question: http://stackoverflow.com/questions/24131476/compiling-and-linking-swift-plus-objective-c-code-from-the-os-x-command-line – Code Different Jun 15 '15 at 22:17
  • But I don't see what the difference would be with an Apple or third party party framework that would warrant use of the CML? With these frameworks you only have the xyz.framework file that you have to import (link/embed binary) into your project. And xcode should be capable of exporting (build/archive) a framework, shouldn't it? – user965972 Jun 16 '15 at 07:11
  • user965972, I agree. I want to build a Login Framework that supports all the different types without the UI. Attach it like an Apple framework is added to a project (e.g. Build Phases allows you to add the Twitter.framework). If there is a google search that finds tip at a minimum... please post here. – Matthew Ferguson Apr 12 '17 at 02:52

0 Answers0