Umbrella header file not updating after changing any swift code

I have a Mix Swift and Objective C project. I first created a project that selected Swift as the language. I have Objective C Bridging headers working absolutely fine as I add new obj c code which I manually update in the header file. I imported ProjectName-Swift.h file into obj c and it worked fine. Now, when I change the code in my swift files or add new swift files, I see that the ProjectName-Swift.h file is not updated with new changes. I tried to manually modify the file and it worked. I cleaned up the project and rebuilt but no luck. I deleted the generated ProjectName-Swift.h file and tried to build, but still the new changes are not showing.

SWIFT_CLASS("_TtC8MyProject13Type2")
@interface Type2 : NSObject
+ (Type2 *)sharedInstance;
- (float)method1:(Type2 *)entity amount:(float)amount;
- (float)method2:(Type1 *)category amount:(float)amount;
- (instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

      

Any solution to this problem?

+3


source to share


1 answer


I know it was a long time ago, but I was just struggling with the same problem when adding a protocol to my Swift code and not being added to the -Swift.h header file.

The problem was that my protocol was not marked as Public. I changed my protocol:

@objc protocol MyProtocol { //etc.... }

      



:

@objc public protocol MyProtocol { //etc.... }

      

+2


source







All Articles