Inherits from NSObject
Declared in SDataGridPullToAction.h
Availability
Related samples

Overview

The SGridPullToAction control attaches to a scrollview, or any class which is a sub-class of UIScrollView. When the user pulls down the scroll view, the Pull to Action control is displayed. If the user pulls down the scroll view past a certain threshold, an action is triggered by the Pull to Action control.

The Pull to Action control has a delegate, which is an instance of SGridPullToActionDelegate. The delegate is used to tell the control when the action is completed.

Tasks

Setup

  • – initWithFrame:

    Initializes and returns an instance of the Pull to Action control with the given frame.

  •   scrollView

    The UIScrollView that the Pull to Action is attached to.

    property
  • – addToScrollView:

    Adds the Pull to Action control as a subview of the specified scrollview.

  •   hidden

    Whether the Pull to Action control is currently visible. This defaults to NO.

    property
  •   frame

    The current frame of the Pull to Action control.

    property

Pull to Action State

  •   pulledAmount

    The current distance that the Pull to Action has been pulled down by, in points.

    property
  •   pullThreshold

    The distance at which an action is triggered, once the pulledAmount has exceeded this value.

    property
  •   executingHeight

    The height of the Pull to Action control during its executing state.

    property

Delegation

  •   delegate

    The delegate for the Pull to Action control.

    property
  • – actionCompleted

    The delegate should call this once it has completed its action. This tells the Pull to Action control to retract back to its idle state.

Styling

  •   style

    This property allows you to configure the look and feel of the Pull to Action control status view.

    property
  •   textForStates

    The status view associates each state of the Pull to Action control with some text.

    property

Properties

delegate

The delegate for the Pull to Action control.

@property (nonatomic, assign) id<SDataGridPullToActionDelegate> delegate

Discussion

Will be sent notifications about changes in state, and the triggering of actions.

Declared In

SDataGridPullToAction.h

executingHeight

The height of the Pull to Action control during its executing state.

@property (nonatomic, assign) CGFloat executingHeight

Discussion

Defaults to 50 points. When the pull gesture ends after having passed the pullThreshold, the Pull to Action control will return to this height, until the actionCompleted method is called.

Declared In

SDataGridPullToAction.h

frame

The current frame of the Pull to Action control.

@property (nonatomic, assign) CGRect frame

Declared In

SDataGridPullToAction.h

hidden

Whether the Pull to Action control is currently visible. This defaults to NO.

@property (nonatomic, assign) BOOL hidden

Declared In

SDataGridPullToAction.h

pullThreshold

The distance at which an action is triggered, once the pulledAmount has exceeded this value.

@property (nonatomic, assign) CGFloat pullThreshold

Discussion

Defaults to 100 points.

Declared In

SDataGridPullToAction.h

pulledAmount

The current distance that the Pull to Action has been pulled down by, in points.

@property (nonatomic, readonly) CGFloat pulledAmount

Declared In

SDataGridPullToAction.h

scrollView

The UIScrollView that the Pull to Action is attached to.

@property (nonatomic, assign) UIScrollView *scrollView

Discussion

We only hold a weak reference, as we are retained by the scrollView as one of its subviews.

Declared In

SDataGridPullToAction.h

style

This property allows you to configure the look and feel of the Pull to Action control status view.

@property (nonatomic, retain, readonly) SDataGridPullToActionStyle *style

Declared In

SDataGridPullToAction.h

textForStates

The status view associates each state of the Pull to Action control with some text.

@property (nonatomic, retain) NSDictionary *textForStates

Discussion

This text is displayed in the status label when the Pull to Action control is in that state. The default mappings are:

SDataGridPullToActionStatePulling => @“Pull to update” SDataGridPullToActionStateTriggered => @“Release to update” SDataGridPullToActionStateExecuting => @“Loading…”

No text is displayed by default for the remaining states.

Declared In

SDataGridPullToAction.h

Instance Methods

actionCompleted

The delegate should call this once it has completed its action. This tells the Pull to Action control to retract back to its idle state.

- (void)actionCompleted

Declared In

SDataGridPullToAction.h

addToScrollView:

Adds the Pull to Action control as a subview of the specified scrollview.

- (void)addToScrollView:(UIScrollView *)scrollView

Declared In

SDataGridPullToAction.h

initWithFrame:

Initializes and returns an instance of the Pull to Action control with the given frame.

- (instancetype)initWithFrame:(CGRect)frame

Declared In

SDataGridPullToAction.h