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 and 3.0 support ? #61

Open
guitoof opened this issue Sep 30, 2016 · 14 comments
Open

Swift 2.3 and 3.0 support ? #61

guitoof opened this issue Sep 30, 2016 · 14 comments

Comments

@guitoof
Copy link

guitoof commented Sep 30, 2016

Hi there,

I updated my Xcode version to 8.0 and it asks me for a Swift conversion to 2.3 or 3.0.
I have therefore updated the Charts and SwiftyJSON pods to use the 2.3 version of Swift but still have errors such as " Type 'CombinedChartView.DrawOrder' has no member 'bar'" in RNCombinedChart.swift and all other swift files in node_modules/react-native-ios-charts.

Not knowing Swift, I haven't been able to fix the errors in order to create a PR on your repo. Can you help me ? Are you maybe currently working on the conversion to support Swift's latest version ?
I would love to help.
Thanks for your answer

@alexkendall
Copy link

+1

@mahlon-gumbs
Copy link
Contributor

@guitoof I'm using Xcode v8.0 and it would always fail on swift conversion for me as well (generating sometimes 999+ errors). I finally got it working by adding the files in step 2 rather than the group (i.e. actually select all the files in the RNiOSCharts folder rather than selecting the folder itself.

The downside is this puts all the files in the ios folder, which is a little frustrating for me since that folder is not cluttered with files.

If anyone knows how to get this working by adding the files as a group, I'm all ears. I'm sure its something simple that I'm missing.

Hope this helps.

@alexkendall
Copy link

I had to use CocoaPods to get it to compile.

@mahlon-gumbs
Copy link
Contributor

@alexkendall I used CocoaPods as well. Were you able to do it with a group or are the RNiOSCharts files in your ios project root directory?

@alexkendall
Copy link

alexkendall commented Oct 7, 2016

@mahlon-gumbs the RNiOSCharts files are in a group inside the node-modules directory. My Podfile file looks like this.

use_frameworks!
target ‘FIAT_Analytics’ do
pod 'SwiftyJSON', git: 'https://github.com/IBM-Swift/SwiftyJSON.git'
pod 'Charts', git: 'https://github.com/danielgindi/Charts.git', branch: ‘Chart2.2.5-Swift3.0’
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end

@mahlon-gumbs
Copy link
Contributor

mahlon-gumbs commented Oct 7, 2016

@alexkendall so for step 2 when you have to "Add files to ", how did you do it? I must have done something wrong because it copied the files from the node modules into my ios folder. i.e. when I do an ls from the command line, I can see all of the Chart files in /ios/.

I'd like to maybe pull them in as a reference or something if that's possible.

---Referring to this step in the readme---
2. Add all the files under node_modules/react-native-ios-charts/RNiOSCharts. (In Xcode: File -> Add files to "App Name")

@alexkendall
Copy link

@mahlon-gumbs Yeah. I would try pulling the files in as a reference instead and make sure copy files isn't selected when you add the files to the project.

@mahlon-gumbs
Copy link
Contributor

@alexkendall I knew it would be something silly on my part. That did it. Thanks!

@L-Jovi
Copy link

L-Jovi commented Oct 31, 2016

@mahlon-gumbs @alexkendall sorry to trouble, I also follow your idea but failed.

I notice that New major release of danielgindi/Charts have full support swift 3.0 and do some breaking changes and I wonder that whether current version of react-native-ios-charts support swift 3.0,

I set use legacy swift language version to No in build settings and ensure that swift 3.0 compiler work, and I upgrade cocoapods to latest version 1.1.1 to ensure that config.build_settings['SWIFT_VERSION'] = '3.0' work as well,

when I try to build, I encounter so many error in react-native-ios-charts files, what should I do now?

thanks for your time,

regards.

@mahlon-gumbs
Copy link
Contributor

@L-Jovi sorry for the late response. Are you still having issues?

Unfortunately it's no longer working for me either on new builds. Seems the dependent branch has been deleted. I'll have to play around a bit to see if I can get this working again for my project.

@L-Jovi
Copy link

L-Jovi commented Nov 6, 2016

@mahlon-gumbs thanks for your reply :)

eventually I can't solve so many error and I roll back to swift 2.3 compiler support,
and I'll appreciate that to be shared the branch if you successfully build the project with swift 3.0

thanks for your time,

regards.

@mahlon-gumbs
Copy link
Contributor

@L-Jovi I followed @aaaaaashu advice here: #65 (use the Swift-3.0 branch from a fork) and that did the trick for me.

Hope that helps you as well.

@L-Jovi
Copy link

L-Jovi commented Nov 7, 2016

@mahlon-gumbs thanks a lot :)

@wuxudong
Copy link

wuxudong commented Mar 6, 2017

I create a new repo, merge this and another android chart lib,
you may check this.
https://github.com/wuxudong/react-native-charts-wrapper

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

5 participants