"MarqueeLabel: Failed to find t for Y input!"
Closed this issue · 5 comments
I am working with tvOS FYI
Context: I have a collectionviewcell that has a marquee label on it...On awakeFromNib of that cell I pause the marquee...When the collectionviewcell becomes focused i call these methods:
titleLabel.restartLabel()
titleLabel.unpauseLabel()
Then when the focus leaves that cell i call:
titleLabel.pauseLabel()
titleLabel.resetLabel()
The bug is when I come back to the cell a second time. When I call:
titleLabel.restartLabel()
titleLabel.unpauseLabel()
I get the "MarqueeLabel: Failed to find t for Y input!" message.
The label doesn't marquee when i come back to it a second time FYI...it just sits there
Hmm, this might be a result of the pausing/unpausing of the label? That error occurs when MarqueeLabel can't figure out how to time the scroll animation, and can be a real pain to debug.
You could try using the holdScrolling
property instead, and see if that avoids the problem? I'd say using holdScrolling
is more appropriate for your use case anyway. To replicate your flow:
In awakeFromNib
:
// do setup, and also set...
titleLabel.holdScrolling = true
// this way the labels won't scroll until you change holdScrolling OR
// manually trigger a scroll with triggerScrollStart()
When the cell becomes focused, and you want to start the scroll:
titleLabel.holdScrolling = false // if scroll is appropriate, it should start automatically
When the focus leaves the cell, and you want to stop the scroll:
titleLabel.holdScrolling = true // prevent auto scrolling
titleLabel.shutdownLabel() // this will return the label to the home position
In looking at this I realized the restartLabel()
function doesn't do what I intended it to do, which is return the label to the home position and subsequently start the scroll if the appropriate conditions are met. The current implementation won't stop an in-flight animation unless the conditions for scroll are met. I'll push an update to correct that, although I don't think that error is directly related to your issue.
Pushed the change described above in release 2.4.0.
that worked great!...thank you
Awesome, glad that fixed it!