MatterGoal
MatterGoal

Reputation: 16430

Swift Framework - public class results as undeclared type

I've written a custom framework in swift. This framework has a lot of classes... and all these classes have been marked as public.

public class Person{ 
...
}

When I import my framework into another project I would expect to be able to use the Person class since it has been marked as public but I'm actually getting an error message saying that Person is an undeclared type.

These are the steps that I follow to include the framework into my project:

  1. Drag framework into the project in Xcode
  2. Add the framework to embedded binaries and to Link binaries with Libraries if is not there already
  3. import the framework where I need to use it with import MYFramework

Am I missing anything?!

Upvotes: 0

Views: 91

Answers (1)

Vicaren
Vicaren

Reputation: 660

You should add public init method

    public init() { }

Upvotes: 1

Related Questions