Skip to content

Commit

Permalink
Add forceScrolling change logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cbpowell committed Jul 21, 2021
1 parent d07b624 commit 112d8b0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Sources/MarqueeLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ open class MarqueeLabel: UILabel, CAAnimationDelegate {
}
}

@IBInspectable public var forceScrolling: Bool = false
/**
A boolean property that sets whether the `MarqueeLabel` should scroll, even if the specificed test string
can be fully contained within the label frame.
Expand All @@ -169,6 +168,15 @@ open class MarqueeLabel: UILabel, CAAnimationDelegate {
- SeeAlso: holdScrolling
- SeeAlso: tapToScroll
*/
@IBInspectable public var forceScrolling: Bool = false {
didSet {
if forceScrolling != oldValue {
if !(awayFromHome || holdScrolling || tapToScroll ) && labelShouldScroll() {
updateAndScroll()
}
}
}
}

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

0 comments on commit 112d8b0

Please sign in to comment.