I'm working on an iOS project that was done few years back in Objective C. So I've to implement some new features to the existing one, so this time I'm using Swift for that purpose.
I've added a new Swift class:
class CampView: UIView
{
// Code
}
I want to access this class in one of my existing Objective C class. So I did like:
@class CampView;
@interface NewCampViewController : UIViewController
@property (nonatomic, strong) IBOutletCollection(CampView) NSArray *campTypes;
@end
But when I connect it to my Storyboard, it is crashing with a message:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key campTypes.'
Also I can't import my system generated Swift header file to this particular class, when I do that it throws an error like :
'MyApp-Swift.h' file not found
That's why I used @class CampView;
in the above snippet. While investigating I found that my NewCampViewController.h
is included in the Objective C bridging header. So suspect it is due to circular dependency, but I couldn't fix it yet.
Can anybody please help me to fix this issue ?