This PR fixes a bug related to the constraints that SkeletonView added to labels when the skeleton is active. The previous logic was:
When the labels are prepared for the skeleton:
Check the desired height for labels.
If needed, backup the current constraints and remove them.
Activate the calculated skeleton constraints.
When the skeleton disappears
Remove all the constraints related to the height.
If there are some constraints backed up, restore them.
The problem was step 1 when the skeleton disappears because we were always removing the height constraints, even if the library had added no constraints.
The solution is to add an identifier to constraints added by the library. Then, SkeletonView only removes the constraints added by the library. So, the logic now when the skeleton disappears is:
Remove all the constraints related to the height added by the library.
If there are some constraints backed up, restore them.
Requirements
[x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
Summary
Fixes #405
This PR fixes a bug related to the constraints that SkeletonView added to labels when the skeleton is active. The previous logic was:
When the labels are prepared for the skeleton:
When the skeleton disappears
The problem was step 1 when the skeleton disappears because we were always removing the height constraints, even if the library had added no constraints.
The solution is to add an identifier to constraints added by the library. Then, SkeletonView only removes the constraints added by the library. So, the logic now when the skeleton disappears is:
Requirements