I have an Xcode project that is a mix of Objective-C(++), C++, and Swift. Some of the Objective-C++ serves as a bridge between Swift and C++.
Say I have an Objective-C class with a public property whose type is a C++ class that I want to use from other parts of the Objective-C code. This will cause a compiler error if the header is imported in the Swift bridging header. Is there a way to hide part of the header of this Objective-C class from Swift?
EDIT: here's a sample header file to illustrate what I mean.
#import <Foundation/Foundation.h>
class MyCppType;
@interface SwiftCancelationToken : NSObject
//I need to expose this so Obj-C can interact with it
@property MyCppType *cppProperty;
-(void)doSomethingWithCppObject;
@end
NS_SWIFT_UNAVAILABLE? developer.apple.com/documentation/swift/…NS_SWIFT_UNAVAILABLEmay work for hiding properties and methods, but I have to expose my C++ object as a property on the wrapper object, which means either forward-declaring its type or importing its header, both of which cause a compiler error. See the edit to the question.