search

Home  >  Q&A  >  body text

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

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

大家讲道理大家讲道理2867 days ago351

reply all(1)I'll reply

  • 迷茫

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

    When adding Swift and OC libraries to CocoaPods at the same time, using use_frameworks!, it is indeed impossible to import OC libraries in Bridging-Header.h, and there is no need to import.
    Just add import OCLibraryName to the head of the swift file to use it. stackoverflow link: http://stackoverflow.com/questions/24122914/how-to-integrate-cocoapods...

    reply
    0
  • Cancelreply