I'm working on creating my own framework, I added objective c files and its working fine after that I needed to add some swift file after adding swift file xcode is not giving me option of auto Creating Bridging then I followed Mix and Match approach. I followed everything which I thing I understand.
I want to access swift file into Objective c but I'm getting error of forward declaration so Here is sample code I attached, kindly guide me where I'm doing wrong.
TestObjectCFile.h
#import <Foundation/Foundation.h>
@class TestSwiftFile;
@interface TestObjCFile : NSObject
@end
TestObjectCFile.m
#import "TestObjCFile.h"
#import <TestFrameworkTry/TestFrameworkTry-Swift.h>
#import "TestFrameworkTry.h"
@implementation TestObjCFile
- (void)TestMethodForImportingSwiftFile
{
TestSwiftFile * testSwiftFile = [[TestSwiftFile alloc] init];
// TestSwiftFile * testSwiftFile = [self returnSwiftClassInstance];
NSLog(@"%@",testSwiftFile);
}
@end
TestSwiftFile.swift
import Foundation
And the error occur on TestObjectCFile.m following line.
TestSwiftFile * testSwiftFile = [[TestSwiftFile alloc] init];