Closed ephemer closed 4 years ago
Merging #302 into master will not change coverage. The diff coverage is
28.57%
.
@@ Coverage Diff @@
## master #302 +/- ##
=======================================
Coverage 51.97% 51.97%
=======================================
Files 87 87
Lines 3161 3161
=======================================
Hits 1643 1643
Misses 1518 1518
Impacted Files | Coverage Δ | |
---|---|---|
Sources/UINavigationBarAndroid.swift | 57.14% <ø> (ø) |
:arrow_up: |
Sources/CALayer+SDL.swift | 0% <0%> (ø) |
:arrow_up: |
Sources/AnimatableProperty.swift | 0% <0%> (ø) |
:arrow_up: |
Sources/UIColor.swift | 19.29% <50%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 592a6b4...c802025. Read the comment docs.
Fixes crashes when storing UIColor or objects containing UIColors in Collections.
Type of change: Bug fix
Motivation (current vs expected behavior)
There are two changes in this PR:
We renamed
UIColor.self.red
etc. to.redValue
to avoid clashing with the static propertiesUIColor.red
etc.We override the
hash
property to stop the Swift runtime from usingObjectIdentifier(self).hashValue
, which is the default for NSObject.From NSObject.swift in swift-corelibs-foundation under
open var hash: Int
:Previously if we created two UIColors using the same input values, we would have had two different hash values objects that were otherwise equatable. That is obviously not what we want, because apparently that breaks some kind of contract in collections. Fixing this issue should fix a lot of crashes we were seeing on Android.
Please check if the PR fulfills these requirements