Not able to import “project-name-Swift.h” file xcode

蓝咒 提交于 2019-12-11 03:58:22

问题


I have 2 files.

  1. "CodeInjection.m"

    #import <Foundation/Foundation.h>
    #import "BiplovCodeInjection-Swift.h"
    
    @interface CodeInjection: NSObject
    @end
    
    @implementation CodeInjection
    
    static void __attribute__((constructor)) initialize(void){
        NSLog(@"==== Code Injection in Action==== with sniffer");
        [[CodeInjectionSwift shared] performTask];
    }
    
    @end
    

My second file is.

"BiplovCodeInjectionSwift.swift"

import Foundation
import NetworkInterceptor

@objc class CodeInjectionSwift: NSObject {
    @objc public static let shared = CodeInjectionSwift()

    override private init(){}

    @objc func performTask(){
        let requestSniffers: [RequestSniffer] = [
            RequestSniffer(requestEvaluator: AnyHttpRequestEvaluator(), handlers: [
                SniffableRequestHandlerRegistrable.console(logginMode: .nslog).requestHandler()
                ])
        ]

        let requestRedirectors: [RequestRedirector] = [
            RequestRedirector(requestEvaluator: DomainHttpRequestEvaluator(domain: "www.antennahouse.com"), redirectableRequestHandler: AlternateUrlRequestRedirector(url: URL(string: "https://www.rhodeshouse.ox.ac.uk/media/1002/sample-pdf-file.pdf")!))
        ]

        let networkConfig = NetworkInterceptorConfig(requestSniffers: requestSniffers,
                                                     requestRedirectors: requestRedirectors)
        NetworkInterceptor.shared.setup(config: networkConfig)
        NetworkInterceptor.shared.startRecording()
    }
}

It fails on the line "#import "BiplovCodeInjection-Swift.h"

I built a new project > framework.

Here's my file strucuture

Why is it that I can't import the header file?

来源:https://stackoverflow.com/questions/58242172/not-able-to-import-project-name-swift-h-file-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!