SPTScrollViewScrubberController Class Reference
| Inherits from | NSObject | 
| Conforms to | UICollectionViewDelegate UIScrollViewDelegate UITableViewDelegate | 
| Declared in | SPTScrollViewScrubberController.h | 
Overview
Instances of SPTScrollViewScrubberController control a scrubber view to
quickly scroll through an UIScrollView or any of its subclasses like
UITableView or UICollectionView.
It was inspired by NSScreencast episode 97: Scrolling Nub (11/28/2013).
UIScrollViewDelegate
It is not necessary that SPTScrollViewController instances are the delegate of the scroll view as long as the following delegate callbacks get passed through:
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
-(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
And additionally these if zooming is enabled for the scroll view:
-(void)scrollViewDidZoom:(UIScrollView *)scrollView
-(void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view
-(void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale
Tasks
Views
- 
	
		scrollViewproperty
- 
	
		scrubberViewproperty
Scroll direction
- 
	
		horizontalScrubbingproperty
- 
	
		verticalScrubbingproperty
- 
	
		minimumHorizontalScrollFactorproperty
- 
	
		minimumVerticalScrollFactorproperty
Scrubber positioning
- 
	
		edgeInsetsproperty
- 
	
		horizontalAlignmentproperty
- 
	
		verticalAlignmentproperty
Scrubber hiding / selecting / highlighting
- 
	
		hideWhileZoomingproperty
- 
	
		selectOnContentSizeChangeproperty
- 
	
		selectOnAnyContentOffsetChangeproperty
- 
	
		highlightScrubberViewproperty
- 
	
		unhighlightScrubberViewproperty
- 
	
		selectScrubberViewproperty
- 
	
		deselectScrubberViewproperty
- 
	
		deselectDelayproperty
- 
	
		deselectAnimationDurationproperty
- 
	
		– flashScrubberView
State
- 
	
		scrubbingproperty
- 
	
		scrubberViewSelectedproperty
Properties
scrollView
The instance of UIScrollView or any of its subclasses to be used with
the scrubber.
@property (nonatomic, strong) IBOutlet UIScrollView *scrollViewDiscussion
The instance of UIScrollView or any of its subclasses to be used with
the scrubber.
Declared In
SPTScrollViewScrubberController.hscrubberView
A UIView instance or any of its subclasses to be used as the scrubber.
@property (nonatomic, strong) IBOutlet UIView *scrubberViewDiscussion
A UIView instance or any of its subclasses to be used as the scrubber.
This view will be added as a subview to the scrollView object, if it has not already been added. The default is a simple 30x30 view with red background color and a corner radius of 15 which results in red dot.
Warning: There must not be any autolayout constraints affecting its layout.
Declared In
SPTScrollViewScrubberController.hhorizontalScrubbing
A Boolean value that determines whether the scrubber should be used for horizontal scrolling.
@property (nonatomic, assign) BOOL horizontalScrubbingDiscussion
A Boolean value that determines whether the scrubber should be used for horizontal scrolling.
The default value is NO.
Declared In
SPTScrollViewScrubberController.hverticalScrubbing
A Boolean value that determines whether the scrubber should be used for vertical scrolling.
@property (nonatomic, assign) BOOL verticalScrubbingDiscussion
A Boolean value that determines whether the scrubber should be used for vertical scrolling.
The default value is YES.
Declared In
SPTScrollViewScrubberController.hminimumHorizontalScrollFactor
The minimum factor the content views width must be larger than the scroll views content areas width at which the scrubber can be used for horizontal scrolling.
@property (nonatomic, assign) CGFloat minimumHorizontalScrollFactorDiscussion
The minimum factor the content views width must be larger than the scroll views content areas width at which the scrubber can be used for horizontal scrolling.
The scroll views content area is determined by adjusting its bounds by its
content insets. The minimumHorizontalScrollFactor must be greater than 1.0.
The default value is 2.0.
Declared In
SPTScrollViewScrubberController.hminimumVerticalScrollFactor
The minimum factor the content views height must be larger than the scroll views content areas height at which the scrubber can be used for vertical scrolling.
@property (nonatomic, assign) CGFloat minimumVerticalScrollFactorDiscussion
The minimum factor the content views height must be larger than the scroll views content areas height at which the scrubber can be used for vertical scrolling.
The scroll views content area is determined by adjusting its bounds by its
content insets. The minimumVerticalScrollFactor must be greater than 1.0.
The default value is 2.0.
Declared In
SPTScrollViewScrubberController.hedgeInsets
The minimum distance the scrubber view is inset from the enclosing scroll view.
@property (nonatomic, assign) UIEdgeInsets edgeInsetsDiscussion
The minimum distance the scrubber view is inset from the enclosing scroll view.
The default value is {10.0,10.0,10.0,10.0}.
Declared In
SPTScrollViewScrubberController.hhorizontalAlignment
The alignment mode for the horizontal axis.
@property (nonatomic, assign) SPTScrollViewScrubberAlignment horizontalAlignmentDiscussion
The alignment mode for the horizontal axis.
The scrubber view is aligned according to this value if it is not used for
horizontal scrolling or if the scrollable area is not large enough. The
default value is SPTScrollViewScrubberAlignmentNone.
See Also
Declared In
SPTScrollViewScrubberController.hverticalAlignment
The alignment mode for the vertical axis.
@property (nonatomic, assign) SPTScrollViewScrubberAlignment verticalAlignmentDiscussion
The alignment mode for the vertical axis.
The scrubber view is aligned according to this value if it is not used for
vertical scrolling or if the scrollable area is not large enough. The
default value is SPTScrollViewScrubberAlignmentNone.
See Also
Declared In
SPTScrollViewScrubberController.hhideWhileZooming
A Boolean value that determines if the scrubber view should be hidden while the user performs a zoom gesture.
@property (nonatomic, assign) BOOL hideWhileZoomingDiscussion
A Boolean value that determines if the scrubber view should be hidden while the user performs a zoom gesture.
The default value is YES.
Declared In
SPTScrollViewScrubberController.hselectOnContentSizeChange
A Boolean value that determines if the scrubber view should be selected when the scroll views content size changes.
@property (nonatomic, assign) BOOL selectOnContentSizeChangeDiscussion
A Boolean value that determines if the scrubber view should be selected when the scroll views content size changes.
The default value is YES.
Declared In
SPTScrollViewScrubberController.hselectOnAnyContentOffsetChange
A Boolean value that determines if the scrubber view should be selected when the scroll views content offset changes for any reason.
@property (nonatomic, assign) BOOL selectOnAnyContentOffsetChangeDiscussion
A Boolean value that determines if the scrubber view should be selected when the scroll views content offset changes for any reason.
If this value is NO the scrubber view will only be selected if content
offset changes have been caused by a drag gesture.
Otherwise the scrubber gets selected for any change of the scroll position,
e.g. status bar taps, programmatically changes to the content offset, or
content size being shrinked.
The default value is YES.
Declared In
SPTScrollViewScrubberController.hhighlightScrubberView
A block which changes properties of the scrubber view to highlight it.
@property (nonatomic, copy) void ( ^ ) ( UIView *view ) highlightScrubberViewDiscussion
A block which changes properties of the scrubber view to highlight it.
This is called when the scrubbing property changes to YES, i.e. a drag
operation on the scrubber view begins. The default block sets the views
highlighted property if it responds to -setHighlighted:.
Declared In
SPTScrollViewScrubberController.hunhighlightScrubberView
A block which changes properties of the scrubber view to unhighlight it.
@property (nonatomic, copy) void ( ^ ) ( UIView *view ) unhighlightScrubberViewDiscussion
A block which changes properties of the scrubber view to unhighlight it.
This is called when the scrubbing property changes to NO, i.e. a drag
operation on the scrubber view ends. The default block unsets the views
highlighted propertxy if it responds to -setHighlighted:.
Declared In
SPTScrollViewScrubberController.hselectScrubberView
A block which changes properties of the scrubber view to select it.
@property (nonatomic, copy) void ( ^ ) ( UIView *view ) selectScrubberViewDiscussion
A block which changes properties of the scrubber view to select it.
This is used in select animation or called directly when the view needs to selected immediatly. The default block sets the scrubber views alpha value to 1.0 and sets the views selected property if it responds to -setSelected:.
Declared In
SPTScrollViewScrubberController.hdeselectScrubberView
A block which changes properties of the scrubber view to unselect it.
@property (nonatomic, copy) void ( ^ ) ( UIView *view ) deselectScrubberViewDiscussion
A block which changes properties of the scrubber view to unselect it.
This is used in unselect animation. The default block sets the scrubber views alpha value to 0.3 and unsets its selected property if it responds to -setSelected:.
Declared In
SPTScrollViewScrubberController.hdeselectDelay
The time interval by which the unselection gets delayed after scrolling.
@property (nonatomic, assign) NSTimeInterval deselectDelayDiscussion
The time interval by which the unselection gets delayed after scrolling.
The default value is 0.75 seconds.
Declared In
SPTScrollViewScrubberController.hdeselectAnimationDuration
A time interval value that determines the duration of deselect animations.
@property (nonatomic, assign) NSTimeInterval deselectAnimationDurationDiscussion
A time interval value that determines the duration of deselect animations.
The default value is 0.5 seconds.
Declared In
SPTScrollViewScrubberController.hscrubbing
A Boolean value that determines if the user is currently dragging the scrubber view.
@property (nonatomic, readonly, getter=isScrubbing) BOOL scrubbingDiscussion
A Boolean value that determines if the user is currently dragging the scrubber view.
Declared In
SPTScrollViewScrubberController.hscrubberViewSelected
A Boolean value that determines if the scrubber view is currently selected.
@property (nonatomic, readonly, getter=isScrubberViewSelected) BOOL scrubberViewSelectedDiscussion
A Boolean value that determines if the scrubber view is currently selected.
Declared In
SPTScrollViewScrubberController.hInstance Methods
flashScrubberView
Flashes the scrubber view by selecting immediately and deselecting it animated.
- (void)flashScrubberViewDiscussion
Flashes the scrubber view by selecting immediately and deselecting it animated.
This method has no effect if the scrubber view is selected.
Declared In
SPTScrollViewScrubberController.h