Closed vegidio closed 3 years ago
Hi Vinícius, Let me try this myself and I will let you know the solution.
I found a workaround for this problem.
Before I change the number of points from 4 to 1, I removed all CATextLayer
objects from the view sublayers:
progressBar.layer.sublayers = progressBar.layer.sublayers?.filter {
!$0.isKind(of: CATextLayer.self)
}
progressBar.numberOfPoints = 1
Hi, is there any update on this? My workaround works, but it would be nice if the lib handled the removal of the sublayers when they are no longer needed, instead of making the developer handle them separately 🙂
Hi,
I created a progress bar with 4 points (
progressBar.numberOfPoints = 4
), but later I want to change this existing progress bar to 1 point (progressBar.numberOfPoints = 1
).The problem is, when I try to change to number of points from 4 to 1, the points disappear, but their texts remain. Following screenshots:
Initially, with 4 points:
After
progressBar.numberOfPoints = 1
, with 1 point:This is the code in my delegate:
How can I make the text under the points disappear as well when I go from 4 to 1 points?