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

Open up Access Modifiers? #3391

Closed
seenoevo opened this issue Apr 11, 2018 · 1 comment
Closed

Open up Access Modifiers? #3391

seenoevo opened this issue Apr 11, 2018 · 1 comment

Comments

@seenoevo
Copy link

seenoevo commented Apr 11, 2018

Previously I've been manually dragging the source files into my project and accessing whatever I need with no issues.

I have started migrating to using CocoaPods for easier future updates, and have ran into some issues.

I have subclassed PieChartView to modify the Pie Chart and am facing some issues:

untitled
untitled2

@liuxuan30

  1. Can the modifier in PieChartView be changed from internal to open so we can override it?...i.e. internal override func calcMinMax() to open override func calcMinMax()

This will allow me to override it in my subclass: public override func calcMinMax()

  1. Can the modifier in ChartViewBase be changed from internal to open so we can gain access to it in our subclass?...i.e. internal var _data: ChartData? to open var data: ChartData?

  2. Can the modifier in ChartViewBase be changed from internal to open so we can gain access to it in our subclass?...i.e. @objc internal var _indicesToHighlight = [Highlight]() to @objc open var indicesToHighlight = [Highlight]()

I've temporarily changed it for the time being, but I hope you can update the library to include this for us?

Thanks!

@liuxuan30
Copy link
Member

well, we are working on Chart 4.0 and swift refactoring. You can check 4.0 branch if it solves the issues. If 4.0 branch does not meet, you can file a PR against 4.0 branch, we will decide if it's ok to make it open.

However, I will point out some methods are meant to be internal or private by design.

If you need to modify, then pick up the source code. But making everything public is not a good design I think. Otherwise there is no need to have access control system.

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