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

Demo in Swift? #1548

Closed
jayvenn opened this issue Sep 24, 2016 · 13 comments
Closed

Demo in Swift? #1548

jayvenn opened this issue Sep 24, 2016 · 13 comments

Comments

@jayvenn
Copy link

jayvenn commented Sep 24, 2016

Is there a demo in Swift?

@digidhamu
Copy link

You can start with this
https://www.appcoda.com/ios-charts-api-tutorial/

@jayvenn
Copy link
Author

jayvenn commented Sep 24, 2016

Yes, I started with that and got what I needed. However, now that I have updated to the latest version for Xcode 8. My project is all messed up :(

@digidhamu
Copy link

digidhamu commented Sep 24, 2016

But don't upgarde to Sierra till 10.12.1 released

@thexande
Copy link

Anybody know when the version supporting swift 3/ Xcode 8 is going to be distributed with pods?

@pmairoldi
Copy link
Collaborator

When version 3.0 is finished. You can use it now by pointing your podfile to the master branch.

@thexande
Copy link

thexande commented Sep 24, 2016

@petester42 Thanks for the tip.

I have it in the podfile like so:

    pod 'Charts', :git => 'https://github.com/danielgindi/Charts.git', :branch => 'master'

Install goes great, i get version 3.0:

screen shot 2016-09-24 at 2 12 05 pm

The problem is when I build, Im getting a Dependency Analysis Error:

   “Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly   for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

As well as the linker error and the script invocation error:

clang: error: linker command failed with exit code 1 (use -v to see invocation)
/Users/alexandermurphy/Library/Developer/Xcode/DerivedData/sparkpoll-cwcuoemcojbuazfttwipycigkggz/Build/Products/Debug-iphonesimulator/sparkpoll.app/Frameworks/Charts.framework: No such file or directory

I think the no file or dir error is caused by the pod not being built because of the legacy swift syntax, but isn't the version 3.0 supposed to support Xcode8 / swift3 combo?

Thanks again!

@pmairoldi
Copy link
Collaborator

You might need to use cocoapods version 1.1.0 for better Xcode 8 support. Try installing 1.1.0.rc.2 and make sure your project has the correct setting for swift 3 before running pod install.

Or you can add a post install hook in your podfile to update the swift version. A quick search on Google will get you the hook.

@thexande
Copy link

thexande commented Sep 24, 2016

@petester42

Your instincts were correct. This was the process to get a successful build using Xcode8 / swift 3 combo:

Step 1: install latest version of cocoapods

gem install cocoapods -v 1.1.0.rc.2

Step 2: set podfile entry

pod 'Charts', :git => 'https://github.com/danielgindi/Charts.git', :branch => 'master'

Step 3: set post install hook for compiler verison

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

Step 4: Build and Rejoice

screen shot 2016-09-24 at 2 39 25 pm

@thexande
Copy link

I am working on putting together a basic demo for this configuration and some basic charts.

@thexande
Copy link

@petester42 Trying to write a demo to close this issue, would you mind taking a quick peek at #1554 ? You might know the problem right away.

@liuxuan30
Copy link
Member

OS X is swift demo. For other issues it's off topic so I am closing.

@lazar108
Copy link

lazar108 commented Mar 1, 2017

@thexande thank god I found this! it helped a lot, using this project was a huge problem

@User2004
Copy link

https://webappcodes.com/category/ios

here is a demo in swift

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

7 participants