I have problem with generated ObjC header file (Project-Swift.h
) from Swift classes.
Header file contains representation of defined Swift classes and all imports of required dependencies. Actually I combine ObjC with Swift in one project together. Everything works fine until I would like create subclass XYZTableViewController
of Swift class ABCTableViewController
from external framework.
Definition of class from swift file:
@objc class XYZTableViewController: ABCTableViewController { ... }
Generated content from Project-Swift.h
:
SWIFT_CLASS("_TtC6Abc22XYZTableViewController")
@interface XYZTableViewController : ABCTableViewController
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER;
- (nonnull instancetype)initWithStyle:(UITableViewStyle)style OBJC_DESIGNATED_INITIALIZER;
@end
Compilation finish with this error:
Project-Swift.h:140:37: Cannot find interface declaration for 'ABCTableViewController', superclass of 'XYZTableViewController'; did you mean 'UITableViewController'?
It works if I'm importing module into .m files for the external framework and defining properties of related class type.
Does have anybody that problem or another similar complications?