Compilation error using TFHpple framework from Swift

前端 未结 1 490
我在风中等你
我在风中等你 2021-01-03 16:57

I have this HTML,

 
相关标签:
1条回答
  • 2021-01-03 17:40

    You should share the precise errors you received, but I had no problems using TFHpple from Swift. As you do with Objective-C, you have to

    • make sure you link to the libxml library in your build phases

    • add $(SDKROOT)/usr/include/libxml2 to your header search paths in the build settings

    See the installation instructions on Wenderlich's How To Parse HTML on iOS or Cocoa with Love's Using libxml2 for XML parsing and XPath queries in Cocoa.

    When you add the TFHpple source to your project, you should be prompted to create a bridging header. Do so, and then add #import "TFHpple" to it. For more information, see the Importing Objective-C into Swift section of the Swift and Objective-C in the Same Project chapter of the Using Swift with Cocoa and Objective-C guide.

    Once you do that, you should be able to use TFHpple without incident from Swift.

    0 讨论(0)
提交回复
热议问题