Learn how to sprinkle a little bit of animation magic onto your three ring custom control.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4276-introducing-custom-controls/lessons/7
Learn how to sprinkle a little bit of animation magic onto your three ring custom control.
Converting to Swift 3 shows the following error message: Cannot express tuple conversion ‘(UIColor, (key: RingIndex, value: RingLayer))’ to ‘(UIColor, (RingIndex, RingLayer))’
for (color, (index, ring)) in zip([UIColor.hrPinkColor, UIColor.hrGreenColor, UIColor.hrBlueColor], rings) {
setColorForRing(index, color: color)
ring.value = 0.0
}
Hi @fschnek,
I think the problem is that the migrator has added labels to one of the tuples but not the other. Without seeing the rest of the code, I would suggest updating the beginning of the line to the following (assuming it compiles…):
for (color, (key: index, value: ring)) in zip...
Not overly convinced that’ll work. If it doesn’t can you paste the definition of rings
and I’ll try to help out.
sam
Awesome @fschnek! Glad it worked
sam