1

I have a class name AppState which is using a swift class object

#import "Sonic-Swift.h"

@interface AppState : NSObject
@property (class) NSMutableArray<"Swift class" *> *entity;

Now I need to use this class (AppState) in the swift file. So I'm trying to import this class in the bridging header.

But after importing this file the app gives an error on the "#import "Sonic-Swift.h"" line "File not found".

failed to emit precompiled header '/Users/krishna_mac_2/Library/Developer/Xcode/DerivedData/Apps-gqelclyzwvyomhcchmjjsejrznaw/Build/Intermediates.noindex/PrecompiledHeaders/Sonic-Bridging-Header-swift_3RJ3MQEOEFTPD-clang_26Q2UBYWMY12Y.pch' for bridging header '/Users/krishna_mac_2/Documents/Documents/Documents/Documents/Documents/Github/Sonic/iOS/Sonic/Sonic-Bridging-Header.h'
koen
  • 5,383
  • 7
  • 50
  • 89
Parv Bhasker
  • 1,773
  • 1
  • 20
  • 39

1 Answers1

4
import "Sonic-Swift.h" 

should be in .m file only.

If you want to use Swift class in .h file then you should use

@class MySwiftClass;
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Prashant Tukadiya
  • 15,838
  • 4
  • 62
  • 98