I'm setting up two frameworks A and B. Framework A is written on Objective-C , and framework B is on swift . Framework B is imported in Framework A and all swift file are accessible within Framework A .

When I import Framework A to separate Xcode Project , I'm not able to access Framework B swift files in application.

Class written in Swift framework

import Foundation

@objc public class CoreCountryModel : NSObject {

  @objc public var CntryId: Int = 0
  @objc public var Cntryname: String?
  @objc public var Cntryiso_code: String?
}

Objective-C Framework , import swift framework to access swift file.

#import <Foundation/Foundation.h>
#import <SwiftFramework/SwiftFramework-Swift.h>

@interface TestClassCountries : NSObject
- (CoreCountryModel *)getCoountries;
@end

Application which using objective C framework to access swift framework files

import UIKit
import ObjectiveCFramework

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

    }
}

When I import objective c framework , Compiler give me 2 errors : 1 - Could not build Objective-C module 'ObjectiveCFramework'. 2 - 'SwiftFramework/SwiftFramework-Swift.h' file not found

How should I resolve these errors ?

0 Answers