Comments (1)
Actually you can do the first half! It's not as straightforward as a single property, but you can immediately set the holdScrolling = true
after creating the MarqueeLabel, and then call triggerScrollStart()
at the appropriate time to trigger a scroll loop. That method overrides the holdScrolling
property only once, so the label will stop scrolling once it completes a loop (at which point you could trigger it again, if you wanted).
I can see a few potential issues with implementing a numberOfRepetitions
property, because MarqueeLabel (as a UIView) doesn't necessarily know what it's container UIViewController is doing. I think to do it right, you might want to subclass MarqueeLabel and integrate it more closely with your UIViewController, since you know exactly what you what to do (i.e. when does the count of loops get reset?).
You can subclass MarqueeLabel and override the labelReturnedToHome(finished: Bool)
property to keep track of when a loop finishes, and maybe increment/decrement a numberOfRepetitions
property (also added to the subclass). When that count meets the right number, you can set holdScrolling == true
to prevent the next loop. Your view controller can then adjust this count value and holdScrolling
when appropriate. Hope this helps!
from marqueelabel-swift.
Related Issues (20)
- Thread 1: EXC_BAD_ACCESS HOT 2
- MarqueeLabel.swift Line 1264 Thread 1: EXC_BAD_ACCESS (code=2, address=0x7fff4f8daff8) HOT 1
- Seemingly random crashes in applyGradientMask:animated: HOT 22
- One MarqueeLabel is not scrolling HOT 3
- "MarqueeLabel: Failed to find t for Y input!" HOT 5
- Does not compile for Swift 1.2 HOT 2
- Short Text makes the code break HOT 13
- Text Not Visible/Offset to the left HOT 4
- NSNotification crash HOT 4
- Zero-length delay with continuous scrolling causes animation jitter HOT 1
- Still doesn't compile
- cant import to swift project "import MarqueeLabel-Swift" HOT 2
- Slow Performance... HOT 9
- Speed issue of label HOT 2
- Label is throwing an exception HOT 4
- Bug: Font resets to System/default on Continuous Scroll HOT 1
- No scroll in CustomCell in TableView HOT 3
- Question: When will be availbale via pod install? HOT 3
- Line height is incorrect when using mutiple attributed strings in a custom table cell HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marqueelabel-swift.