-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Add Collection conformances to ChartDataSet types #3815
Conversation
should we use 4.0 branch? I suppose there would be conflicts later. |
|
||
return removed | ||
guard let index = firstIndex(of: entry) else { return false } | ||
_ = remove(at: index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm checking isIndirectValuesCall
here, it seems in remove(at:)
, we didn't call isIndirectValuesCall = true
and we delete it here. Is it a mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was on purpose. We always want to call notifiyDataSetChanged
in our current implementation, so I go rid of it and let the property observer take car of it.
BTW, should we use 4.0 branch? I suppose there would be conflicts later? I'm going to try merge a few PRs and release a new version. Not sure if we should include this one. |
Codecov Report
@@ Coverage Diff @@
## master #3815 +/- ##
==========================================
- Coverage 32.67% 32.63% -0.04%
==========================================
Files 114 114
Lines 10754 10809 +55
==========================================
+ Hits 3514 3528 +14
- Misses 7240 7281 +41
Continue to review full report at Codecov.
|
I think the deprecations should come in before Chart 4. There are already a ton of conflicts, so it doesn't matter to me |
@jjatie while I'm pushing pod trunk, got several warnings from pod:
I'm using |
Those are warnings intentionally generated by us. We won't be removing |
but if we don't have to remove |
and then internally we only reference the internal var. |
sure. let's do this with another PR |
@jjatie I'm trying to fix the warnings, but I found there are demos using BarChartDataSet *set = nil;
if (_chartView.data.dataSetCount > 0)
{
set = (BarChartDataSet *)_chartView.data.dataSets[0];
set.values = yValues;
[_chartView.data notifyDataChanged];
[_chartView notifyDataSetChanged];
} what you suggest? btw, why do we want to deprecate |
@jjatie can you get this notification? I didn't have a perfect idea yet, I'm thinking disable deprecate until we find a good way. |
Goals ⚽
Allow more familiar API for collection types, the ability to implement more generic algorithms and simplify many existing algorithms by taking advantage of Collection conformances.
Implementation Details 🚧
ChartDataSet adopts conformances:
MutableCollection
RandomAccessCollection
RangeReplaceableCollection