Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 2.3 - Build Issue #1

Closed
vsavic opened this issue Oct 3, 2016 · 9 comments
Closed

Swift 2.3 - Build Issue #1

vsavic opened this issue Oct 3, 2016 · 9 comments
Labels

Comments

@vsavic
Copy link

vsavic commented Oct 3, 2016

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.

@iabudiab
Copy link
Owner

iabudiab commented Oct 3, 2016

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:

  • If you are using CocoaPods then make sure that you open the Xcode workspace instead of the project file after the pod install command.
  • If you have a swift project then import the library via 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.

@vsavic
Copy link
Author

vsavic commented Oct 3, 2016

When I try to add it like that just with import HTMLKit, this is what I get:

http://image.prntscr.com/image/937e20c6fc8b4104bc5b528899538be5.png

@iabudiab
Copy link
Owner

iabudiab commented Oct 3, 2016

Do you have a swift project? and are you opening the workspace that was generated by CocoaPods?

@vsavic
Copy link
Author

vsavic commented Oct 3, 2016

Yes I'm opening workspace. And yes I have a swift project, which was in swift 2 and now migrated to swift 2.3

@iabudiab
Copy link
Owner

iabudiab commented Oct 3, 2016

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.

@vsavic
Copy link
Author

vsavic commented Oct 3, 2016

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.

@iabudiab
Copy link
Owner

iabudiab commented Oct 3, 2016

Either version should work fine.

  • Make sure that you do not include any bridging headers manually, CocoaPods does that for you.
  • Make sure that you have use_frameworks! in the Podfile
  • Make sure that the target's Use 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.

@vsavic
Copy link
Author

vsavic commented Oct 3, 2016

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!

@iabudiab
Copy link
Owner

iabudiab commented Oct 3, 2016

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 ..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants