I have a swift protocol IModelIdProvider
in the MyProjectName
folder.
I have created an objective-c unit test class named RemoteModelFactoryTest<
I know its extra hacky and everything, but what I did and it worked was to copy public headers from generated "Project-Swift.h" and paste whats needed to .m file of test.
So I copied something like this:
SWIFT_CLASS("_TtC10Inventorum11ImageEntity")
@interface ImageEntity : NSObject
@property (nonatomic, copy) NSString * imageID;
@property (nonatomic) NSURL * retinaImageURL;
@property (nonatomic) NSURL * nonRetinaimageURL;
@property (nonatomic, readonly) NSURL * imageURL;
@property (nonatomic, readonly, copy) NSString * UUID;
@property (nonatomic, readonly, copy) NSString * sourceImageUUID;
@property (nonatomic) RACSignal * rac_signalForImage;
- (instancetype)init OBJC_DESIGNATED_INITIALIZER;
- (NSURL *)sourceImageURLWithFormatName:(NSString *)formatName;
- (FICEntityImageDrawingBlock)drawingBlockForImage:(UIImage *)image withFormatName:(NSString *)formatName;
- (void)objc_setType:(NSString *)type;
@end
And on top of this I have also copied all the macros for SWIFT_CLASS etc. My tests are building and passing testing Swift code.
BTW. Dont forget to put public on tested classes and methods in Swift.