-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
MyProject-Swift.h header not found when embedding framework into ObjectiveC project #303
Comments
I'm fighting this same issue. +1 |
Sometimes the -Swift.h header is not created until you manually create a Swift file in your project. So here's what you should do:
|
Are you importing the sources manually? Did you make sure that all the files are in your target? |
First approach I tried was importing/dragging the .xcodeproj file into my project, thought it'd be a good start, but in the future I'll need to support iOS7 when using Charts in an actual app. I'll make sure everything belong to my target and try again. Or is this only applicable to importing the sources manually? |
Or guys, just read the README. It specifically says that for iOS 7 you should add the .swift files, not the framework! |
And by the way, AWESOME library @danielgindi , you're getting a dinner + beer sometime soon :) |
Thanks :-) On Mon, Aug 17, 2015 at 5:03 PM, edulpn [email protected] wrote:
|
Ah, this was for iOS 8... I'll try iOS 7 later. |
iOS7 is what you finally did... On Mon, Aug 17, 2015 at 5:05 PM, edulpn [email protected] wrote:
|
Gotcha... Thanks for the help! |
@danielgindi Why does this NewChartDemo-Swift.h go and do we even need it? I have a swift project and a bridging header. but can't do # import "NewChartDemo-Swift.h". I took it out and in my swift file did import Charts. PS I'm on iOS and added this as a embedded framework as per instructions |
${Your project name}-Swift.h is for objc based project to use swift code I remember. It is generated by XCode, to translate swift code to a header file for objc to import. If you don't need to use swift in objc project, you don't need it. As you can see you are simply a swift project, everything is swift. |
@liuxuan30 Ah crap. I got rattled by this without reading that ITS FOR AN OBJECTIVE-C PROJECT!!! Though I'm left with one issue still |
then it goes to swift :-) Check how your 'object' is declared. and its dataSet property. |
@liuxuan30 to be honest, I'm not yet familiar with Charts library. The error is in the "ChartSelectionDetail" file |
I have a feeling this is a bug in Xcode 7 beta 6 |
@acegreen try stackoverflow. or create a new issue with details, current info cannot tell what's wrong. To me it's more like a swift compiler error. should be easy resovled on SO |
I have framework using bridge file created in sample framework project and i import same bridge file in another project.So i will import same bridge file in framework project and sample project means what happen? |
I tried following the usage guidelines on the README for ObjectiveC projects several times and it never creates the "-Swift.h" header file so I can import.
I do as follows:
1 - Drag the Charts.xcodeproj to my project
(Cmd + B -> Build Successful)
2 - Go to your target's settings, hit the "+" under the "Embedded Binaries" section, and select the Charts.framework
(Cmd + B -> Build Successful) This should do step 3 of the Guide
(Since it's a ObjectiveC project, I jump to step 5)
5 - Under "Build Options", mark "Embedded Content Contains Swift Code"
(Cmd + B -> Build Successful) After this build I think my "-Swift.h" header file should be already generated, so we should be good, right?!
Alright, so by now I should be able to do a simple
#import "NewChartDemo-Swift.h"
, but then:Am I missing something? I wasn't able to achieve the expected results in any of my several tries, looked up StackOverflow for other people having trouble importing Swift Frameworks into ObjectiveC projects and none of the work arounds work for me.
The text was updated successfully, but these errors were encountered: