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

Import with Swift(not objc) not working #14

Closed
ricardo85x opened this issue Apr 8, 2015 · 8 comments
Closed

Import with Swift(not objc) not working #14

ricardo85x opened this issue Apr 8, 2015 · 8 comments

Comments

@ricardo85x
Copy link

Hi

I am trying to build a very simple code using swift.
But I can't figure out how can I import the Classes.

When I set the view to be PieChartView and create a :
@IBOutlet weak var testView: PieChartView!

I got "use of undeclared type: PieChartView

I did try to import PieChartView, but xcode can't find it.

I am using Xcode 6.3 beta 4 and already setup the "Embedded Binaries" and "Linked Frameworks and Libraries" to the Charts.framework.

Also I can't find one sample code of swift on the web.

Thanks

@danielgindi
Copy link
Collaborator

You need to import the Charts namespace.

@ricardo85x
Copy link
Author

Hello Daniel
I am not sure how to do that.

The import Charts also do not work.

I did tried to create a bridging header with: #import < Charts/Charts.h >

And in my ViewController I did add:
import Charts.

It did compile, but I got this error when the app start:

fatal error: unexpectedly found nil while unwrapping an Optional value

on ChartViewBase file in the line with:
if (noDataTextDescription!.lengthOfBytesUsingEncoding(NSUTF16StringEncoding) > 0)

@danielgindi
Copy link
Collaborator

danielgindi commented Apr 8, 2015 via email

@ricardo85x
Copy link
Author

my Xcode version is: Version 6.3 (6D554n)
from this installer:(Xcode_6.3_beta_4.dmg)

@ricardo85x
Copy link
Author

I replaced this line with: if (noDataTextDescription != nil && noDataTextDescription!.lengthOfBytesUsingEncoding(NSUTF16StringEncoding) > 0)

and now it is working

@danielgindi
Copy link
Collaborator

Ok, you were right, there is an issue :-)

@danielgindi
Copy link
Collaborator

I have already pushed a fix

danielgindi added a commit that referenced this issue Apr 8, 2015
danielgindi added a commit that referenced this issue Apr 8, 2015
@ricardo85x
Copy link
Author

thanks!
Now I was able to create a working chart :)

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

No branches or pull requests

2 participants