Am getting error while calling swift function in objective c file. I have created "-Swift.h" file.
I have created ".swift" file. My code here is
import Foundation
@objc class className : NSObject {
@objc func someFunc(sender: AnyObject) {
//Some code
}
}
I have created "-Swift.h" header file. My code here is
#ifndef ProjectName_Swift_h
#define ProjectName_Swift_h
#endif /* ProjectName_Swift_h */
@class className;
@interface className : NSObject
-(void)someFunc;
@end
In my objective C ".m" file am calling the swift function.
#import "XXX-Swift.h"
- (void)viewDidLoad
{
[super viewDidLoad];
className *obj = [[className alloc]init];
[obj someFunc];
}
Now am getting error in "XXX-Swift.h" file.
ERROR: Cannot find interface declaration for 'NSObject', super class for 'className'.