Closed vsavic closed 7 years ago
You don't have to change anything in the CocoaPod in order for it to work. Here are some things you could check to troubleshoot the problem:
pod install
command.import HTMLKit
and not #import "HTMLKit/HTMLKit.h"
because that is what you would use for an Objective-C project, well not exactly, since you have to use the #import <HTMLKit/HTMLKit.h>
syntax. (notice the angle-brackets, here is a relative SO answer about local and global includes http://stackoverflow.com/a/1044399/719656)Let me know if this helps.
When I try to add it like that just with import HTMLKit
, this is what I get:
http://image.prntscr.com/image/937e20c6fc8b4104bc5b528899538be5.png
Do you have a swift project? and are you opening the workspace that was generated by CocoaPods?
Yes I'm opening workspace. And yes I have a swift project, which was in swift 2 and now migrated to swift 2.3
Take a look a this demo project. It is a fresh Xcode 8 iOS project using legacy Swift (2.3) with a Podfile having HTMLKit. HTMLKitDemo.tar.gz
In the ViewController.swift
you'll find a minimalistic example of it in action. Let me know if your setup is different.
The only difference was pod version, you have 1.0 and I had 0.9.4. Everything else is the same... But for some reason, when I install this it does not work even with new version 1.0. But your project works...very strange, everything else is the same.
Either version should work fine.
use_frameworks!
in the PodfileUse Modules (C and Objective-C)
is set to YES
(which also should have been set for you, but better sure ..)And since it helps more often than anyone cares to admit, perform a complete clean (command + alt + shift + k) then build again.
All good my friend! Thank you so much for your help! I was an idiot! ...the problem was with CocoaPods version....not with your pod version, but with my CocoaPods version, I didn't notice which version it was, since I don't work with iOS very often, but now I just finished with update, and reinstall all pods again, and everything works like a charm!
You can close this issue and mark it as user issue :)
Excellent library BTW!
No problem, glad it worked out for you! And don't beat yourself up about it, this happens to everybody, sometimes on daily basis (looking at Angular2 and all it betas and routers ..)
I installed your library as you suggested by using cocoa-pods, but after I tried to include it in my project in my bridge-header I keep getting bunch of errors that these *.h files like HTMLElement.h etc. does not exist, even doe I see them in pod folder. Any idea why?
I'm using XCode 8 and Swift 2.3.
UPDATE What I had to do to make it works (for now), I had to mark each of these "missing" files as "public" in cocoa-pod.