Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to access the public class from framework iOS Swift

enter image description hereHi i have created a framework with a swift file having a public class. When i try to use this public class in the app project that i have linked this framework to , the xcode shows that there are no such class.

public class TestFrame {
   public func hello() {
       print("Hello World")
   }
}

This is the class from my framework.

First i build the framework for my device, then link that file to the embedded binaries in my app project. Then i include a import statement of the framework name and then try to use this class(which is not possible at this stage).The Only file that i am able to access through framework is the .h(header file) of the framework. So what i need to do to get this class accessed in my app project.

like image 410
pramod aravind Avatar asked Oct 25 '25 13:10

pramod aravind


1 Answers

The problem is that you built the framework for the device (arm) and now you are trying to link it to the simulator platform (i386).

You can either build two frameworks (one for the device, one for simulator), build a 'fat' framework including both architectures or you drag the framework project to your workspace so it is always built with for the selected target platform.

like image 150
Florian L. Avatar answered Oct 27 '25 02:10

Florian L.