ScrollIdleCondition
open class ScrollIdleCondition
extension ScrollIdleCondition: ViewCondition
View condition with minimum percentage that will be satisfied only when the scrollView has stopped scrolling
- Condition will be met when minimum view percentage is satisfied and parent scroll view is idle
- Condition will fail when minimum percentage condition fails after a previous success
-
Initializes
ScrollIdleCondition
with provided minimum view percentageDeclaration
Swift
public init(minPercentage: Float)
Parameters
minPercentage
Minimum percentage of the view that needs to be visible to satisfy the condition
- Ranges from 0 - 100
-
Called when the condition is met (satisfied)
Subclasses should perform tasks that need to be done after condition is satisfied here
Important
This method needs to be overridden in subclasses, else it will throw a fatal error
Note
This method is always called on the main thread
Declaration
Swift
open func conditionMet()
-
Called when the condition fails after previously being met
Subclasses should perform tasks that need to be done after condition is failed here
Important
This method needs to be overridden in subclasses, else it will throw a fatal error
Note
This method is always called on the main thread
Declaration
Swift
open func conditionFailed()
-
Declaration
Swift
public func evaluate(for state: ScrollState, viewPercentage: Float)
-
Declaration
Swift
public func reset()