在myproject-swift.h中找不到接口声明

问题描述 投票:4回答:1

我在我的项目中使用XLPagerTabStrip pod,

我有一个桥接头用于其他目的,从swift到客观c myproject-swift.h集成

我不能构建项目,这个错误总是弹出:

无法找到'ButtonBarPagerTabStripViewController'的接口声明,'ParentViewController'的超类

enter image description here

这是我的控制器

import Foundation
import UIKit
import XLPagerTabStrip

class ParentViewController: ButtonBarPagerTabStripViewController {

    override func viewDidLoad() {
        tabStripStyle()
        super.viewDidLoad()
        containerView.isScrollEnabled = false
    }
   } 

我已经看到这个问题无处不在,但这里尚未回答:'Cannot find interface declaration' in auto-generated Swift bridging header

快速SR-805 SR-5398的臭虫

objective-c swift xcode header xlpagertabstrip
1个回答
3
投票

您需要为框架和应用程序目标导入-Swift.h

例如 :

    #import <UIKit/UIKit.h>
    #import <AVFoundation/AVFoundation.h>
    #import <Foundation/Foundation.h>
    #import "XLPagerTabStrip-Swift.h"
    #import "RealmSwift-Swift.h"
    ...... // Add all frameworks, subclasses, and dependance ios frameworks
    #import  "MyProject-Swift.h"

你可以阅读这个article如何导入文件头和检查路径

© www.soinside.com 2019 - 2024. All rights reserved.