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

Still seeing undeclared UIColor, CGFloat error with latest code #133

Closed
liuxuan30 opened this issue Jun 8, 2015 · 3 comments
Closed

Still seeing undeclared UIColor, CGFloat error with latest code #133

liuxuan30 opened this issue Jun 8, 2015 · 3 comments

Comments

@liuxuan30
Copy link
Member

I am trying to add the whole charts directory into my Objective-C project, so the structure is:

ThirdParty
|
ios-charts
|
classes
|
Animation, Charts, Components, Data, Filters, Renderers, Utils

What I changed the project setting:

  1. enable embedded content contains swift code
  2. Defines Module: YES

I also see the setting shows the $Module_name-Swift.h was set, but I don't see xcode generates it.

After I try build,

It throws lots of errors like undeclared CGFloat, UIColor, etc. I searched the closed issues, but they are not my case. My code is the latest.

What did I miss?

@liuxuan30
Copy link
Member Author

The files having errors:
BubbleChartDataSet.swift, BubbleChartDataEntry.swfit, BubbleChartDataEntry,swift, BubbleChartData.swift, BubbleChartRenderer.swift

@liuxuan30
Copy link
Member Author

Alright, I found that the BubbleChart related swift file is missing something like:

import Foundation
import CoreGraphics.CGBase
import UIKit

After I manually add them, errors gone.

Now the questions are:

Q1: chart demo code does not report any issue even without import UIKit stuff. Why? Do I have to set any flag in my objective-C project?

Q2: I see some files are using import CoreGraphics.CGBase while some are import CoreGraphics, and some are import UIKit, while some are import UIKit.UIColor

I am not sure if we should follow the small package scope principle? I am not sure if I use import UIKit.UIColor will better than import UIKit in performance perspective

@quentinhayot
Copy link

Same issue here with the swift files drop method (for iOS 7 support). Had to add the imports you specified.

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

3 participants