suchen

Heim  >  Fragen und Antworten  >  Hauptteil

objective-c - 使用CocoaPods时,Swift文件中中无法同时使用OC的库和Swift的库?

CocoaPods中添加Swift写的库需要使用use_frameworks!,但如果也有OC写的库的话,Bridging-Header.h中就貌似就无法import OC的库了?

大家讲道理大家讲道理2867 Tage vor350

Antworte allen(1)Ich werde antworten

  • 迷茫

    迷茫2017-04-24 09:14:41

    当在CocoaPods同时添加Swift和OC的库,使用use_frameworks!后,在Bridging-Header.h中的确是无法import OC的库,也无需import。
    只需要在swift文件头部,添加import OCLibraryName,即可使用。stackoverflow链接:http://stackoverflow.com/questions/24122914/how-to-integrate-cocoapods...

    Antwort
    0
  • StornierenAntwort