Skip to content

Commit 112d8b0

Browse files
committed
Add forceScrolling change logic
1 parent d07b624 commit 112d8b0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Sources/MarqueeLabel.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ open class MarqueeLabel: UILabel, CAAnimationDelegate {
153153
}
154154
}
155155

156-
@IBInspectable public var forceScrolling: Bool = false
157156
/**
158157
A boolean property that sets whether the `MarqueeLabel` should scroll, even if the specificed test string
159158
can be fully contained within the label frame.
@@ -169,6 +168,15 @@ open class MarqueeLabel: UILabel, CAAnimationDelegate {
169168
- SeeAlso: holdScrolling
170169
- SeeAlso: tapToScroll
171170
*/
171+
@IBInspectable public var forceScrolling: Bool = false {
172+
didSet {
173+
if forceScrolling != oldValue {
174+
if !(awayFromHome || holdScrolling || tapToScroll ) && labelShouldScroll() {
175+
updateAndScroll()
176+
}
177+
}
178+
}
179+
}
172180

173181
/**
174182
A boolean property that sets whether the `MarqueeLabel` should only begin a scroll when tapped.

0 commit comments

Comments
 (0)