Closed Jenus closed 6 years ago
So I think you're experiencing a known issue/effect, in that MarqueeLabel by itself can't always accurately detect when its container view is presented or dismissed. But if I'm understanding you correctly, it actually works better in iOS 11?
Your workaround is the right way to handle it: manually trigger the scroll at the appropriate time for your app. You could also use the triggerScrollStart
function, or any of the convenience methods as described in this section of the Readme.
Let me know if I'm misunderstanding your issue somehow!
Going to close this one for now - it's a known "issue" but MarqueeLabel provides you the tools to manually control the label when it's unable to do so itself. Please comment back if you think there's a solution that fixes it though!
@cbpowell Hi, I also have the same problem. Specifically, if you swipe back more quickly, you will get this bug. And this bug is very stable on iOS10.
@Jenus Hey, did you fix this bug?
@Jenus "Calling marqueeLabel.restartLabel() in the ViewDidAppear of ViewController A." works for me, thank you!
@iTofu Sorry I meant to reply yesterday but got distracted - using restartLabel()
like you figured out is probably the best way to guarantee it starts scrolling again. MarqueeLabel tries to automatically restart as best it can, but it's "just" a UILabel subclass so by itself it doesn't necessarily get automatic notification of when view controllers appear and disappear. The group of functions like restartLabel()
are intended to help make things work the way you intend.
Glad you found a solution! I'll take another look to see if there's a solution to this issue when I get a chance too.
@cbpowell You are too polite, and thank you for maintaining this repo 👍
Usage Details
Expected Behavior
when swipe back to the original ViewController, marqueeLabel can scroll again
Actual Behavior
when swipe back to the original ViewController, marqueeLabel can scroll stoped
Steps to Reproduce the Problem
The upper problem doesn't exist when iOS 11 or when swiping softly below iOS 11( iOS 10); When debugging, the line sublabel.layer.add(scroller.anim, forKey: "position") CATransaction.commit() //set breakpoint when commit() function execute stepped, scroll animation works. It stopped when click the button of "continue program execute".
Btw, it works around this way: Calling marqueeLabel.restartLabel() in the ViewDidAppear of ViewController A.