I have visited this links -
MyClass is unavailable: cannot find Swift declaration for this class - Release Build Only
Adding Linked or Embedded Swift Framework: 'MyClass' is unavailable: cannot find Swift declaration for this class
Swift: using private framework
But none of the above links helped me to solve my problem.
I am developing an App using objective-c, in the app I am integrating ios-charts whose framework is developed in swift.I have merged the project as given in the README file. After integrating i have created a MyClass.swift file and then inherited the MyClass.swift file with a Class which is defined in charts.framework
.But this is rising an error
'Class' is unavailable: cannot find Swift declaration for this class
Does anyone help me to solve this error? Any suggestions??
This may be due to possibility that you are building for device and using for simulator and vice-versa. Please check this. This is very important thing. If you compiled or build framework for device, it will not work on simulator.
My fix for this problem was to change the deployment target of the framework from my device to “Generic iOS Device” and then rebuild the framework.
Try adding @objc infront of the MyClass declaration (i.e. @objc class MyClass {...})
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