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

Error: cannot use instance member '_viewPortHandler' within property initializer; property initializers run before 'self' is available #3434

Closed
1 task done
castus opened this issue Apr 29, 2018 · 3 comments

Comments

@castus
Copy link

castus commented Apr 29, 2018

After update I have two error during compiling. Please see info below.

What did you do?

Update pod to Charts 3.1.1 (was 3.0.3)

What did you expect to happen?

It will compile as before ;)

What happened instead?

Two errors during compilation:

  1. Error:(75, 76) cannot use instance member '_viewPortHandler' within property initializer; property initializers run before 'self' is available in BarLineChartViewBase.swift
  2. Error:(611, 121) type 'NSAttributedStringKey' (aka 'NSString') has no member 'font' in BarChartRenderer.swift

Charts Environment

Charts version/Branch/Commit Number: 3.1.1
Xcode version: 9.3
Swift version: 3.3
Platform(s) running Charts: ios
macOS version running Xcode: High Sierra

@thierryH91200
Copy link
Contributor

thierryH91200 commented Apr 29, 2018

find the intruder / the mistake
read readme

  • Xcode 9.3 / Swift 4.1
  • iOS >= 8.0 (Use as an Embedded Framework)
  • tvOS >= 9.0
  • macOS >= 10.11

@castus
Copy link
Author

castus commented Apr 29, 2018

🤦‍♂️ Now I see, thanks.

But, don't you think that versioning is wrong?
3.0.4 was a first release with Swift 4 which was backwards-uncompatible. In my opinion it should be 3.1 then. I had ~> 3.0.3 in my podfile so it should work up to 3.1, but after an update the project stops to compile.
What do you think?

@liuxuan30
Copy link
Member

liuxuan30 commented May 7, 2018

We don't provide support for legacy swift. I tried on my side, changing to Swift 3.3 won't compile as well, the same errors you are facing. So if you think it should compile, report to Apple.

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