I created a basic project with a swift package(let's call it "Foo") related to this project.
I tried printing "hello world" from Foo().text
from AppDelegate
and I get an error:
"Cannot call value of non-function type 'module<Foo>' "
I then tried to add a new struct or class to this package and I get an error: "Cannot find {ObjectName} in scope"
Tests inside Foo all passed.
It looks like I missing some step(s).
Don't confuse a module with a public class (or struct). That's what it sounds like you are doing here:
Saying
Foo()
implies there is a public class/struct called Foo. Is there? I don't think so. You might have a package called Foo, which youimport
. But that does not mean that the Foo package has a public class (or struct) called Foo.For example you might see this in your package:
But that does not mean you can simply
import Foo
and then talk aboutFoo().text
, because this Foo is not public.