Reputation: 111
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
To create the framework, I picked a Cocoa Touch Framework project. The structure of the project: framework project structure
I marked the classes public class AVSManager {}
and the init()
functions as public.
Copied the .framework file to the root of the other projects
In the projects, I added the framework as embedded binary
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
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