How do I import a Swift class from a framework?
TestClass
in that Cocoa touch framework import FrameWorkTest
The application project compiler can't find TestClass
.
How can I import TestClass
for use in the main application?
It says that TestClass
is not defined. I also want to add an extension in FrameWork an then use it.
https://github.com/ArtemKyslicyn/-SwiftImportFrameworkTest
I'm using this Tutorial http://www.swift-studies.com/blog/2014/6/30/creating-a-pure-swift-framework-for-both-ios-and-mac
I'm on Xcode version 6.0 seed
Thanks
Make the class in framework public. Also any variables must be public if you want them to use outside the framework.
public class MyClass... {
...
}
Here's one solution I found:
+
to add targetcocoa touch framework
project
and press add dependency
and add framework
I used the solution here: https://github.com/ArtemKyslicyn/-SwiftImportFrameworkTest in the project named AddingFrameWork
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With