How can I add forward class references used in the -Swift.h header?

You can create another header file that forward declares or imports the necessary classes, and then imports ProjectName-Swift.h. For example, create a file named ProjectName-Swift-Fixed.h with the contents:

// ProjectName-Swift-Fixed.h

// Forward declarations for property classes
@class DeletionWorkflow;

// Imports for superclasses
#import "MyTableViewController.h";

#import "ProjectName-Swift.h"

Then, instead of #import "ProjectName-Swift.h" in your codebase, use #import "ProjectName-Swift-Fixed.h.

Leave a Comment