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

Replaced backing variables with proper access control #3104

Closed
wants to merge 4 commits into from
Closed

Replaced backing variables with proper access control #3104

wants to merge 4 commits into from

Conversation

jjatie
Copy link
Collaborator

@jjatie jjatie commented Dec 14, 2017

This is a non-breaking change
No logic was changed, and the external interface remains the same. Only internal names have been changed (dropping "_")
This excludes Bool values, as to change those breaks the external interface. Those changes are handled by #2687
Greatly reduces the code base, and keeps logic together.

This is a non-breaking change
No logic was changed, and the external interface remains the same. Only internal names have been changed (dropping "_")
This excludes Bool values, as to change those breaks the external interface.
Greatly reduces the code base, and keeps logic together.
@jjatie
Copy link
Collaborator Author

jjatie commented Dec 14, 2017

@liuxuan30 Could you make this one a priority? It will cause merge conflicts in many of my PRs and I would like to get them out of the way.

There are no logic changes, just removing backing variables across the board (except for Bools as noted in PR notes) like you've seen in a few other PRs already.

@jjatie
Copy link
Collaborator Author

jjatie commented Dec 18, 2017

@liuxuan30 I'm investigating why the test are failing. I'll let you know when it's fixed.

@liuxuan30
Copy link
Member

liuxuan30 commented Dec 19, 2017

Sorry just saw this. #3034 and this, which one first?
before merging, I need to add a small UT to check the demos do compile and run.

@jjatie
Copy link
Collaborator Author

jjatie commented Dec 19, 2017

#3034. Sounds good. I won't have time to fix this PR until the weekend.

@liuxuan30
Copy link
Member

liuxuan30 commented Dec 22, 2017

It's the end of year, so everyone is quite occupied :) I will try review 1-2 PR a week 😂

/// The minimum interval between axis values.
/// This can be used to avoid label duplicating when zooming in.
///
/// **default**: 1.0
@objc open var granularity: Double
@objc open private(set) var granularity = 1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

old granularity setter is public.

/// Use `resetCustomAxisMin()` to undo this.
@objc open internal(set) var axisMinimum = 0.0 {
willSet {
_customAxisMax = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why willSet here? can't be in didSet?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was following the order in the former setters because I didn't want to change any logic in this PR. I agree it can all be done in didSet. Should I change it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. The old setter is atomic I assume, so will/did seems the same in our case.

/// The minimum value for this axis.
/// If set, this value will not be calculated automatically depending on the provided data.
/// Use `resetCustomAxisMin()` to undo this.
@objc open internal(set) var axisMinimum = 0.0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

axisMinimum is also accessed from outside of framework.

/// The maximum value for this axis.
/// If set, this value will not be calculated automatically depending on the provided data.
/// Use `resetCustomAxisMax()` to undo this.
@objc open internal(set) var axisMaximum = 0.0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same to axisMinimum. Seems you missed some context to make setter internal?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I was just tired and missed a couple things ; )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Demo to test could help trigger the errors?

@jjatie jjatie changed the base branch from master to 4.0.0 January 4, 2018 09:15
@jjatie jjatie added this to the 4.0.0 milestone Jan 8, 2018
@jjatie
Copy link
Collaborator Author

jjatie commented Jan 16, 2018

This is too big of a change to switch from master to 4.0.0. Will implement this in pieces as part of other changes.

@jjatie jjatie closed this Jan 16, 2018
@jjatie jjatie removed this from the 4.0.0 milestone Jan 16, 2018
@ChartsOrg ChartsOrg locked as resolved and limited conversation to collaborators Jan 16, 2018
@jjatie jjatie deleted the access-control branch January 16, 2018 22:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants