Issues with Swift generated header file

孤者浪人 提交于 2019-12-22 10:13:53

问题


I've got a project using Mapbox. The code base is mixed objC and Swift code. The class using Mapbox is written in Swift but is exposed to legacy objC code. I'm using !use_frameworks in my pod file to be able to use Swift pods as well. The problem I'm facing is that generated -swift.h file is wrong.

This is the problematic bit:

#if defined(__has_feature) && __has_feature(modules)
@import ObjectiveC;
@import Mapbox;
@import CoreGraphics;
@import Foundation;
@import UIKit;
#endif

__has_feature(modules) is false so it won't import Mapbox module and the build fails later in the file

@interface MapBoxView : NSObject <MGLMapViewDelegate>

since it doesn't know the MGLMapViewDelegate.

I've got all the Define modules, Enable modules, etc. set to Yes in all project/target settings. Any ideas?

来源:https://stackoverflow.com/questions/33379636/issues-with-swift-generated-header-file

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