Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why swift cannot find my Objective-C class in ProductModule-Swift.h

I have this code a Custom class which extends UIImageView in Objective-C.

When I add to the project and add import to bridging header file my swift class can see and use the code as usual but when i try to compile it.

I always get this error

enter image description here

I don't know why it is only happen to my CarBigImageView, I try to change the name of the file , create new file with new name and copy all the code there but none seem to work.

but other custom view such as Marker seem to be fine?

UPDATE : ADD MORE INFORMATION

here is my bridging header

#import <AFNetworking/AFNetworking.h>
#import <AFNetworking/UIImageView+AFNetworking.h>
#import <GSKeychain.h>
#import <JSONKit.h>

#import "CarBigImageView.h"
#import "sqlite3.h"
#import <time.h>
#import "Bridge.h"
#import "Marker.h"

here is my "CarBigImageView.h"

#import <UIKit/UIKit.h>

@protocol CarBigImageViewDelegate <NSObject>

- (void)didTouchColor:(UIColor*)coloc atPosition:(CGPoint)point;

@end

@interface CarBigImageView : UIImageView

@property (weak, nonatomic) id<CarBigImageViewDelegate> delegate;

@end

and here what it looks in the editor

enter image description here

and the result when compile

enter image description here

How can i solve this?

like image 479
SaintTail Avatar asked Oct 01 '22 11:10

SaintTail


1 Answers

Make sure you left Xcode know where to find that file: in build settings look for "Objective-C Bridging Header". The value for that field should be something similar to "$(SRCROOT)/path/to/your/Bridging-Header.h" If you fill this out and hit enter, it SRCROOT will expand, and you can check if that full path is correct path.

like image 63
Joride Avatar answered Oct 17 '22 09:10

Joride