tomwyckhuys
tomwyckhuys

Reputation: 111

Custom Swift framework not exposing classes

I made a custom Swift framework to reuse the same code across different projects. However, when I import the framework in other projects, the classes are not available for use.

Things I already did

  1. To create the framework, I picked a Cocoa Touch Framework project. The structure of the project: framework project structure

  2. I marked the classes public class AVSManager {} and the init() functions as public.

  3. Copied the .framework file to the root of the other projects

  4. In the projects, I added the framework as embedded binary

  5. Imported the framework in the ViewController.swift class of a project: import AVSCMDI

When I then try to call AVSManager() it produces the following error: AVSManager is unavailable: cannot find Swift declaration for this class

Does anybody have an idea what i'm missing here?

Thanks in advance!

Upvotes: 3

Views: 2172

Answers (1)

tomwyckhuys
tomwyckhuys

Reputation: 111

I found the solution to my problem!

It turned out that I needed to build my framework with a real device as target.

Upvotes: 7

Related Questions