I have a very strange problem: "Can't find the type RCTResponseSenderBlock in scope." It's strange, because in one case it is there and in the other it doesn't, looks like a bug.
This is screenshot issue.
This my Objective-C file:
#import <Foundation/Foundation.h>
#import "React/RCTBridgeModule.h"
#import <React/RCTEventEmitter.h>
#import <React/RCTConvert.h>
@interface RCT_EXTERN_MODULE(BLEclass, NSObject)
RCT_EXTERN_METHOD(addEvent:(NSString *)name callback:(RCTResponseSenderBlock)callback )
@end
And this my Swift file, where i have issue :
import Foundation
@objc(BLEclass)
class BLEclass: NSObject{
@objc(addEvent:callback:)
func addEvent(_ name: String,_ callback:RCTResponseSenderBlock){
NSLog("%@", name);
let resultsDict = [
"name" : name
];
callback([NSNull(),resultsDict])
}
}
If you know how to fix it, please write answer.
Thanks.