Conforms to UIScrollViewDelegate
Declared in SGridDelegate.h
Availability
Related samples

Overview

The delegate of a ShinobiGrid object must adopt the SGridDelegate protocol. The delegate concerns itself with the style of rows, columns and gridlines and can receive notifications that a cell is about to be selected (via a single tap) or that a cell has been edited (via a double-tap).

The delegate should only be used for styling where you wish to provide a style for a particular row, column or gridline, or where each row/column/gridline is to have its own distinct style. If you wish to apply a uniform row/column/gridline style for the entire grid then the properites defaultRowStyle, defaultColumnStyle and defaultGridLineStyle of your ShinobiGrid object are designed for this purpose and provide better performance than use of the delegate.

Warning: Important In certain cases row styles and column styles can conflict (a cell can belong to a row and column that have been given different styles). In this case the style is applied based on the BOOL rowStylesTakePriority property of the ShinobiGrid object.

Tasks

Styling Rows and Columns

Styling Gridlines

Styling Section Headers

Grid Layout/Render Notifications

Receiving Section Expand and Collapse Notifications

Cell Selection Notifications

Cell Editing Notifications

Cell Gesture Notifications

Receiving Row Selection Notifications

Column Resizing Notifications

Column and Row Reordering Notifications

Reordering Arrow Notifications

Instance Methods

didFinishLayingOutShinobiGrid:

Tells the delegate that the grid has finished laying out.

- (void)didFinishLayingOutShinobiGrid:(ShinobiGrid *)grid

Parameters

grid

The grid which has finished laying out/rendering.

Discussion

The grid lays out, and subsequently calls this method, upon initial render/layout, section collapse/expand and device rotation.

Declared In

SGridDelegate.h

shinobiGrid:alterStyle:beforeApplyingToCellAtCoord:

Gives the delegate a chance to change the style that is about to be applied to a particular cell.

- (void)shinobiGrid:(ShinobiGrid *)grid alterStyle:(SGridCellStyle *)styleToApply beforeApplyingToCellAtCoord:(const SGridCoord *)coord

Parameters

grid

The grid that the cell belongs to.

styleToApply

The style about to be applied to the cell.

coord

The coord that identifies the location of the cell.

Discussion

This method is called whenever a cell is about to have a style applied to it, either upon a layout of the grid or upon a scroll gesture bringing a new cell into view.

Declared In

SGridDelegate.h

shinobiGrid:arrowImageForOrientation:forCellAtCoord:

Asks the delegate for an image that will be used for an arrow that is displayed when the user initiates the drag/drop of a column/row.

- (UIImage *)shinobiGrid:(ShinobiGrid *)grid arrowImageForOrientation:(SGridArrowOrientation)orientation forCellAtCoord:(const SGridCoord *)gridCoord

Parameters

grid

The grid that is requesting the arrow image.

orientation

The orientation of the image that is being requested - this signifies whether the arrow is pointing up, down, left or right.

gridCoord

The coordinates of the cell that will display the arrow image.

Return Value

A UIImage that will be used for the arrow in the cell at gridCoord that points in the direction orientation.

Declared In

SGridDelegate.h

shinobiGrid:cellCanRespondToDoubleTap:

Asks the delegate whether a cell in the grid can respond to a double tap. Use this method to speed up single taps on cells which don’t respond to a double tap.

- (BOOL)shinobiGrid:(ShinobiGrid *)grid cellCanRespondToDoubleTap:(SGridCell *)cell

Parameters

grid

The grid containing the cell that has been tapped.

cell

The cell which may be double tapped.

Declared In

SGridDelegate.h

shinobiGrid:colAtIndex:hasBeenSwitchedWithColAtIndex:

Informs the delegate that two columns within the ShinobiGrid object have been switched.

- (void)shinobiGrid:(ShinobiGrid *)grid colAtIndex:(NSInteger)colIndexSwitched hasBeenSwitchedWithColAtIndex:(NSInteger)colIndexSwitchedWith

Parameters

grid

The grid that contains the columns that have been switched.

colIndexSwitched

The first switched column.

colIndexSwitchedWith

The second switched column.

Discussion

This method gives the delegate an opportunity to update the data source appropriately.

Warning: Important When a user drags and drops a column this only reorders the currently visible cells. Therefore it is important to update your data source so that when scrolling/panning takes place, the cells that become visible appear in the correct order.

Declared In

SGridDelegate.h

shinobiGrid:didCollapseSectionAtIndex:

Tells the delegate that a section within the ShinobiGrid object has collapsed.

- (void)shinobiGrid:(ShinobiGrid *)grid didCollapseSectionAtIndex:(NSUInteger)sectionIndex

Parameters

grid

The grid which contains the section that has collapsed.

sectionIndex

The index of the section that has collapsed.

Declared In

SGridDelegate.h

shinobiGrid:didDeselectCellAtCoord:

Tells the delegate that a cell within the ShinobiGrid object has been deselected.

- (void)shinobiGrid:(ShinobiGrid *)grid didDeselectCellAtCoord:(const SGridCoord *)gridCoord

Parameters

grid

The grid containing the cell that has been deselected.

gridCoord

The coordinate of the cell that has been deselected.

Declared In

SGridDelegate.h

shinobiGrid:didDeselectRow:

Informs the delegate that the deselection of an entire row has just happened as a result of the user having tapped a cell.

- (void)shinobiGrid:(ShinobiGrid *)grid didDeselectRow:(SGridRow)row

Parameters

grid

The grid that has just had a row set as deselected.

row

The row that has just been set as deselected.

Discussion

Note that cellSelectionMode must be set to SGridSelectionModeRowSingle or SGridSelectionModeRowMulti for this delegate method to be called and that the cell selection delegate methods such as shinobiGrid:didSelectCellAtCoord: will be called before this method.

Declared In

SGridDelegate.h

shinobiGrid:didEndReorderingColumnAtIndex:

Informs the delegate that the column reordering operation has been completed

- (void)shinobiGrid:(ShinobiGrid *)grid didEndReorderingColumnAtIndex:(NSUInteger)colIndex

Parameters

grid

The grid which contains the column which has been reordered

colIndex

The index of the column in its final resting place

Discussion

This method is called after the column is dropped back into position when the user’s dragging gesture has been completed.

Declared In

SGridDelegate.h

shinobiGrid:didEndReorderingRow:

Informs the delegate that the row reordering operation has been completed

- (void)shinobiGrid:(ShinobiGrid *)grid didEndReorderingRow:(SGridRow)row

Parameters

grid

The grid which contains the row which has been reordered

row

The grid row in its final resting place

Discussion

This method is called after the row is dropped back into position when the user’s dragging gesture has been completed.

Declared In

SGridDelegate.h

shinobiGrid:didEndResizingColumnAtIndex:fromWidth:toWidth:

Tells the delegate that a column has completed. This method is called once per resizing operation - just after the column user’s pinch gesture has ended.

- (void)shinobiGrid:(ShinobiGrid *)grid didEndResizingColumnAtIndex:(NSUInteger)columnIndex fromWidth:(CGFloat)oldWidth toWidth:(CGFloat)newWidth

Parameters

grid

The grid containing the column which has been resized

columnIndex

The index of the column which has been resized

oldWidth

The width that the column at columnIndex was before the resize.

newWidth

The width that the column at columnIndex now has

Declared In

SGridDelegate.h

shinobiGrid:didExpandSectionAtIndex:

Tells the delegate that a section within the ShinobiGrid object has expanded.

- (void)shinobiGrid:(ShinobiGrid *)grid didExpandSectionAtIndex:(NSUInteger)sectionIndex

Parameters

grid

The grid which contains the section that has expanded.

sectionIndex

The index of the section that has expanded.

Declared In

SGridDelegate.h

shinobiGrid:didFinishEditingAutoCell:

Informs the delegate that a cell within the ShinobiGrid object has been edited.

- (void)shinobiGrid:(ShinobiGrid *)grid didFinishEditingAutoCell:(const SGridTextInputCell *)cell

Parameters

grid

The grid which contains the cell that has been edited.

cell

The cell within grid that has been edited.

Discussion

This method gives the delegate an opportunity to feed back any changes that the user makes to the grid to the data source. Note that this delegate method only works in conjunction with SGridAutoCell (or its descendants).

Declared In

SGridDelegate.h

shinobiGrid:didResizeColumnAtIndex:fromWidth:toWidth:

Tells the delegate that a column has resized to a new width.

- (void)shinobiGrid:(ShinobiGrid *)grid didResizeColumnAtIndex:(NSUInteger)columnIndex fromWidth:(CGFloat)oldWidth toWidth:(CGFloat)newWidth

Parameters

grid

The grid containing the column that has been resized.

columnIndex

The index of the column that has been resized.

oldWidth

The width that the column at columnIndex used to be before the resize.

newWidth

The width that the column at columnIndex now has.

Discussion

This method is called continously as a user’s pinch gesture changes. Each call to this method is made just after a column’s width has changed.

Declared In

SGridDelegate.h

shinobiGrid:didSelectCellAtCoord:

Tells the delegate that a cell within the ShinobiGrid object is about to be selected.

- (void)shinobiGrid:(ShinobiGrid *)grid didSelectCellAtCoord:(const SGridCoord *)gridCoord

Parameters

grid

The grid which contains the cell that is about to be selected.

gridCoord

The coordinate of the cell that is about to be selected.

Discussion

This method gives the delegate an opportunity to apply a custom selection style/animation to the cell or another part of the grid.

Declared In

SGridDelegate.h

shinobiGrid:didSelectRow:

Informs the delegate that the selection of an entire row has just happened as a result of the user having tapped a cell.

- (void)shinobiGrid:(ShinobiGrid *)grid didSelectRow:(SGridRow)row

Parameters

grid

The grid that that has just had a row set as selected.

row

The row that has just been set as selected.

Discussion

Note that cellSelectionMode must be set to SGridSelectionModeRowSingle or SGridSelectionModeRowMulti for this delegate method to be called and that the cell selection delegate methods such as shinobiGrid:didSelectCellAtCoord: will be called before this method.

Declared In

SGridDelegate.h

shinobiGrid:didTapCellAtCoord:isDoubleTap:

Tells the delegate that a cell within the ShinobiGrid object has been tapped.

- (void)shinobiGrid:(ShinobiGrid *)grid didTapCellAtCoord:(const SGridCoord *)gridCoord isDoubleTap:(BOOL)isDoubleTap

Parameters

grid

The grid containing the cell that has been tapped.

gridCoord

The coordinate of the cell that has been tapped.

isDoubleTap

Indicates whether the cell has been double tapped (single tap otherwise).

Declared In

SGridDelegate.h

shinobiGrid:offsetForArrowImageWithOrientation:forCellAtCoord:

Asks the delegate for the offset of an arrow image that is going to be displayed due to the user having initiated the drag/drop of a column/row.

- (CGPoint)shinobiGrid:(ShinobiGrid *)grid offsetForArrowImageWithOrientation:(SGridArrowOrientation)orientation forCellAtCoord:(const SGridCoord *)gridCoord

Parameters

grid

The gird that is requesting the offset.

orientation

The orientation of the arrow that will have the offset applied to it.

gridCoord

The coordintates of the cell that will display the arrow image.

Return Value

A CGPoint that represents the offset that will be applied to the arrow in the cell at gridCoord that points in the direction orientation.

Discussion

This method allows you to provide an offset that will change the position of the arrow image that is about to be displayed.

Declared In

SGridDelegate.h

shinobiGrid:permittedDragDirectionForCellAtCoord:

Asks the delegate for which drag and drop directions are permitted. This query is triggered from a gesture originating on the cell at a given coord.

- (SGridDragDirection)shinobiGrid:(ShinobiGrid *)grid permittedDragDirectionForCellAtCoord:(SGridCoord *)coord

Parameters

grid

The grid asking for the drag decision.

coord

The coord of the cell that the gesture originated from.

Return Value

An entry from the SGridDragDirection enum that controls the action the grid will take.

Declared In

SGridDelegate.h

shinobiGrid:row:hasBeenSwitchedWithRow:

Informs the delegate that two rows within the ShinobiGrid object have been switched.

- (void)shinobiGrid:(ShinobiGrid *)grid row:(SGridRow)rowSwitched hasBeenSwitchedWithRow:(SGridRow)rowSwitchedWith

Parameters

grid

The grid that contains the rows that have been switched.

rowSwitched

The first switched row.

rowSwitchedWith

The second switched row.

Discussion

This method gives the delegate an opportunity to update the data source appropriately.

Warning: Important When a user drags and drops a row this only reorders the currently visible cells. Therefore it is important to update your data source so that when scrolling/panning takes place, the cells that become visible appear in the correct order.

Declared In

SGridDelegate.h

shinobiGrid:shouldBeginEditingAutoCell:

Asks the delegate if a cell should respond to an edit event.

- (BOOL)shinobiGrid:(ShinobiGrid *)grid shouldBeginEditingAutoCell:(const SGridTextInputCell *)cell

Parameters

grid

The grid containing the cell in question.

cell

The cell which wants to know if it should respond to an edit event.

Return Value

A BOOL that indicates if the cell will respond to an edit event. YES results in the cell responding, otherwise the cell ignores the edit event.

Declared In

SGridDelegate.h

shinobiGrid:shouldBeginResizingColumnAtIndex:

Asks the deleage whether a column should be allowed to resize in response to a user’s pinch gesture.

- (BOOL)shinobiGrid:(ShinobiGrid *)grid shouldBeginResizingColumnAtIndex:(NSUInteger)columnIndex

Parameters

grid

The grid that contains the column which wants to resize.

columnIndex

The index of the column that is about to begin resizing.

Declared In

SGridDelegate.h

shinobiGrid:shouldCollapseSectionAtIndex:

Asks the delegate whether a section within the ShinobiGrid should be allowed to collapse. This will only be called when a user taps the header of a currently expanded section. It will not be called when a section is collapsed programmatically.

- (BOOL)shinobiGrid:(ShinobiGrid *)grid shouldCollapseSectionAtIndex:(NSUInteger)sectionIndex

Parameters

grid

The grid which contains the section which would like to collapse

sectionIndex

The index of the section which would like to collapse

Declared In

SGridDelegate.h

shinobiGrid:shouldDeselectCellAtCoord:

Asks the delegate whether a currently selected cell that has been tapped should be marked as deselected.

- (BOOL)shinobiGrid:(ShinobiGrid *)grid shouldDeselectCellAtCoord:(const SGridCoord *)gridCoord

Parameters

grid

The grid which contains the cell in question.

gridCoord

The coordinate of the cell in question.

Discussion

This can be used to control deselection on a cell by cell basis.

Declared In

SGridDelegate.h

shinobiGrid:shouldDeselectRow:

Asks the delegate whether the currently selected row should be marked as deselected as the result of a tap gesture on a cell.

- (BOOL)shinobiGrid:(ShinobiGrid *)grid shouldDeselectRow:(SGridRow)row

Parameters

grid

The ShinobiGrid which contains the row in question.

row

The row which may or may not be deselected depending on the return value.

Return Value

A BOOL that indicates if row should be marked as deselected.

Discussion

This method can only be called if the grid’s cellSelectionMode is set to SGridSelectionModeRowSingle or SGridSelectionModeRowMulti. Note that the cell selection/deselection delegate methods will be called after this method.

Declared In

SGridDelegate.h

shinobiGrid:shouldExpandSectionAtIndex:

Asks the delegate whether a section within the ShinobiGrid should be allowed to expand. This will only be called when a user taps the header of a currently collapsed section. It will not be called when a section is expanded programmatically.

- (BOOL)shinobiGrid:(ShinobiGrid *)grid shouldExpandSectionAtIndex:(NSUInteger)sectionIndex

Parameters

grid

The grid which contains the section which would like to expand

sectionIndex

The index of the section which would like to expand

Declared In

SGridDelegate.h

shinobiGrid:shouldSelectCellAtCoord:

Asks the delegate whether a currently unselected cell that has been tapped should be marked as selected.

- (BOOL)shinobiGrid:(ShinobiGrid *)grid shouldSelectCellAtCoord:(SGridCoord *)gridCoord

Parameters

grid

The grid which contains the cell in question.

gridCoord

The coordinate of the cell in question.

Discussion

This can be used to control selection on a cell by cell basis.

Declared In

SGridDelegate.h

shinobiGrid:shouldSelectRow:

Asks the delegate whether the indicated row should be marked as selected as the result of a tap gesture on a cell.

- (BOOL)shinobiGrid:(ShinobiGrid *)grid shouldSelectRow:(SGridRow)row

Parameters

grid

The ShinobiGrid which contains the row in question.

row

The row which may or may not be selected depending on the return value.

Return Value

A BOOL that indicates if row should be marked as selected.

Discussion

This method can only be called if the grid’s cellSelectionMode is set to SGridSelectionModeRowSingle or SGridSelectionModeRowMulti. Note that the cell selection/deselection delegate methods will be called after this method.

Declared In

SGridDelegate.h

shinobiGrid:styleForColAtIndex:

Asks the delegate for the style to be used for a particular column within the ShinobiGrid object.

- (SGridColRowStyle *)shinobiGrid:(ShinobiGrid *)grid styleForColAtIndex:(NSInteger)colIndex

Parameters

grid

The grid that is requesting the column style.

colIndex

The column within grid that is requesting the style.

Return Value

The SGridColRowStyle object representing the style that will be applied to column at colIndex within grid.

Discussion

Note that columns are zero-indexed.

Declared In

SGridDelegate.h

shinobiGrid:styleForHorizontalGridLineAtIndex:inSection:

Asks the delegate for the style to be used for a particular horizontal gridline within the ShinobiGrid object.

- (SGridLineStyle *)shinobiGrid:(ShinobiGrid *)grid styleForHorizontalGridLineAtIndex:(NSInteger)gridLineIndex inSection:(NSInteger)sectionIndex

Parameters

grid

The grid that is requesting the horizontal gridline style.

gridLineIndex

The horizontal gridline for the section within grid that is requesting the style.

sectionIndex

The section that the horizontal gridline belongs to.

Return Value

The SGridLineStyle object representing the style that will be applied to the gridline at gridLineIndex with orientation.

Discussion

Gridlines are zero indexed - where the first horizontal grid line for a section appears underneath the first row of a section. Note that horizontal gridlines are zero-indexed within sections (that is to say that the first gridline in any section has a gridLineIndex of 0). The last row of a section also has a gridline appear underneath it (unlike the last column of a grid). Returning nil for a particular gridline will result in the defaultGridLineStyle property of your ShinobiGrid object being applied.

Declared In

SGridDelegate.h

shinobiGrid:styleForRowAtIndex:inSection:

Asks the delegate for the style to be used for a particular row within the ShinobiGrid object.

- (SGridColRowStyle *)shinobiGrid:(ShinobiGrid *)grid styleForRowAtIndex:(NSInteger)rowIndex inSection:(NSInteger)sectionIndex

Parameters

grid

The grid that is requesting the style.

rowIndex

The row within grid that is requesting the row style.

sectionIndex

The section that the row belongs to.

Return Value

The SGridColRowStyle object representing the style that will be applied to row at rowIndex of section at sectionIndex within grid.

Discussion

Note that rows and sections are zero-indexed.

Declared In

SGridDelegate.h

shinobiGrid:styleForSectionHeaderAtIndex:

Asks the delegate for the style to be used for a particular sections header.

- (SGridSectionHeaderStyle *)shinobiGrid:(ShinobiGrid *)grid styleForSectionHeaderAtIndex:(NSInteger)sectionIndex

Parameters

grid

The grid which owns the section that is requesting the header style.

sectionIndex

The index of the section that is requesting the header style.

Return Value

An object representing the style that will be applied to the section at sectionIndex of grid.

Discussion

Use this method if you wish to specify different styles for each section header. If you wish to style all section headers uniformly then use the defaultSectionHeaderStyle property of your ShinobiGrid object for better performance. Section headers are zero-indexed.

Declared In

SGridDelegate.h

shinobiGrid:styleForVerticalGridLineAtIndex:

Asks the delegate for the style to be used for a particular vertical gridline within the ShinobiGrid object.

- (SGridLineStyle *)shinobiGrid:(ShinobiGrid *)grid styleForVerticalGridLineAtIndex:(NSInteger)gridLineIndex

Parameters

grid

The grid that is requesting the vertical gridline style.

gridLineIndex

The vertical gridline within grid that is requesting the style.

Return Value

The SGridLineStyle object representing the style that will be applied to the gridline at gridLineIndex with orientation.

Discussion

Gridlines are zero indexed - where the first vertical grid line appears to the right of the first column of cells. Returning nil for a particular gridline will result in the defaultGridLineStyle property of your ShinobiGrid object being applied.

Declared In

SGridDelegate.h

shinobiGrid:widthForResizingColAtIndex:withCurrentWidth:targetWidth:

Asks the grid for the width that a column that is currently being resized should be set to.

- (NSNumber *)shinobiGrid:(ShinobiGrid *)grid widthForResizingColAtIndex:(NSUInteger)columnIndex withCurrentWidth:(CGFloat)currentWidth targetWidth:(CGFloat)targetWidth

Parameters

grid

The grid requesting the width for the resizing column.

columnIndex

The index of the column that is being resized.

currentWidth

The current width of the resizing column.

targetWidth

The width that the resizing column will be set to if this method had not been implemented (or nil is returned from this method).

Return Value

An NSNumber object that represents the width that the resizing column will be set to. Return nil if you wish for the target width to be set.

Declared In

SGridDelegate.h

shinobiGrid:willBeginEditingAutoCell:

Tells the delegate that a cell within the ShinobiGrid grid object will begin editing.

- (void)shinobiGrid:(ShinobiGrid *)grid willBeginEditingAutoCell:(const SGridTextInputCell *)cell

Parameters

grid

The grid which contains the cell that will begin editing.

cell

The cell within grid that will begin editing.

Declared In

SGridDelegate.h

shinobiGrid:willBeginResizingColumnAtIndex:

Tells the delegate that a column is about to begin resizing.

- (void)shinobiGrid:(ShinobiGrid *)grid willBeginResizingColumnAtIndex:(NSUInteger)columnIndex

Parameters

grid

The grid that contains the column that is about to begin resizing.

columnIndex

The index of the column that is about to begin resizing.

Discussion

This method will be called once before any resizing actually takes place.

Declared In

SGridDelegate.h

shinobiGrid:willCollapseSectionAtIndex:

Tells the delegate that a section within the ShinobiGrid object is about to be collapsed.

- (void)shinobiGrid:(ShinobiGrid *)grid willCollapseSectionAtIndex:(NSUInteger)sectionIndex

Parameters

grid

The grid which contains the section that is about to collapse.

sectionIndex

The index of the section that is about to collapse.

Declared In

SGridDelegate.h

shinobiGrid:willCommenceEditingAutoCell:

Tells the delegate that a cell within the ShinobiGrid grid object will begin editing.

- (void)shinobiGrid:(ShinobiGrid *)grid willCommenceEditingAutoCell:(const SGridTextInputCell *)cell

Parameters

grid

The grid which contains the cell that will begin editing.

cell

The cell within grid that will begin editing.

Discussion

Warning: Important: This method has been deprecated in preference of shinobiGrid:willBeginEditingAutoCell:.

Declared In

SGridDelegate.h

shinobiGrid:willDeselectCellAtCoord:

Tells the delegate that a cell within the ShinobiGrid object is about to be deselected.

- (void)shinobiGrid:(ShinobiGrid *)grid willDeselectCellAtCoord:(const SGridCoord *)gridCoord

Parameters

grid

The grid containing the cell that will be deselected.

gridCoord

The coordinate of the cell that is about to be deselected.

Declared In

SGridDelegate.h

shinobiGrid:willDeselectRow:

Informs the delegate that the deselection of an entire row is about to happen as a result of the user having tapped a cell.

- (void)shinobiGrid:(ShinobiGrid *)grid willDeselectRow:(SGridRow)row

Parameters

grid

The grid that is about to have a row set as deselected.

row

The row that is about to be deselected.

Discussion

Note that cellSelectionMode must be set to SGridSelectionModeRowSingle or SGridSelectionModeRowMulti for this delegate method to be called and that the cell selection delegate methods such as shinobiGrid:didSelectCellAtCoord: will be called after this method.

Declared In

SGridDelegate.h

shinobiGrid:willEndReorderingColumnAtIndex:

Informs the delegate that the column reordering operation is about to be completed

- (void)shinobiGrid:(ShinobiGrid *)grid willEndReorderingColumnAtIndex:(NSUInteger)colIndex

Parameters

grid

The grid which contains the column which has been reordered

colIndex

The index of the column in its final resting place

Discussion

This method is called before the column is dropped back into position when the user’s dragging gesture has been completed.

Declared In

SGridDelegate.h

shinobiGrid:willEndReorderingRow:

Informs the delegate that the row reordering operation is about to be completed

- (void)shinobiGrid:(ShinobiGrid *)grid willEndReorderingRow:(SGridRow)row

Parameters

grid

The grid which contains the row which has been reordered

row

The grid row in its final resting place

Discussion

This method is called before the row is dropped back into position when the user’s dragging gesture has been completed.

Declared In

SGridDelegate.h

shinobiGrid:willEndResizingColumnAtIndex:fromWidth:toWidth:

Tells the delegate that a column is about to complete resizing. This method is called once per resizing operation - just after the column user’s pinch gesture has ended.

- (void)shinobiGrid:(ShinobiGrid *)grid willEndResizingColumnAtIndex:(NSUInteger)columnIndex fromWidth:(CGFloat)oldWidth toWidth:(CGFloat)newWidth

Parameters

grid

The grid containing the column which has been resized

columnIndex

The index of the column which has been resized

oldWidth

The width that the column at columnIndex was before the resize.

newWidth

The width that the column at columnIndex now has

Declared In

SGridDelegate.h

shinobiGrid:willExpandSectionAtIndex:

Tells the delegate that a section within the ShinobiGrid object is about to be expanded.

- (void)shinobiGrid:(ShinobiGrid *)grid willExpandSectionAtIndex:(NSUInteger)sectionIndex

Parameters

grid

The grid which contains the section that is about to expand.

sectionIndex

The index of the section that is about to expand.

Declared In

SGridDelegate.h

shinobiGrid:willResizeColumnAtIndex:fromWidth:toWidth:withXCenter:

Tells the delegate that a column will resize to a new width.

- (void)shinobiGrid:(ShinobiGrid *)grid willResizeColumnAtIndex:(NSUInteger)columnIndex fromWidth:(CGFloat)currentWidth toWidth:(CGFloat)newWidth withXCenter:(CGFloat)xCenter

Parameters

grid

The grid containing the column that will be resized.

columnIndex

The index of the column that will be resized.

currentWidth

The width that the column at columnIndex currently has.

newWidth

The width that the column at columnIndex will change to.

xCenter

The center, in points, of the column that is about to begin resizing.

Discussion

This method is called continously as a user’s pinch gesture changes. Each call to this method is made just prior to changing a columns width. If you want the width to be set to something other than newWidth then see the method shinobiGrid:widthForResizingColAtIndex:.

Declared In

SGridDelegate.h

shinobiGrid:willSelectCellAtCoord:

Tells the delegate that a cell within the ShinobiGrid object has been selected.

- (void)shinobiGrid:(ShinobiGrid *)grid willSelectCellAtCoord:(const SGridCoord *)gridCoord

Parameters

grid

The grid which contains the cell that has been selected.

gridCoord

The coordinate of the cell that has been selected.

Declared In

SGridDelegate.h

shinobiGrid:willSelectRow:

Informs the delegate that the selection of an entire row is about to happen as a result of the user having tapped a cell.

- (void)shinobiGrid:(ShinobiGrid *)grid willSelectRow:(SGridRow)row

Parameters

grid

The grid that is about to have a row set as selected.

row

The row that is about to be selected.

Discussion

Note that cellSelectionMode must be set to SGridSelectionModeRowSingle or SGridSelectionModeRowMulti for this delegate method to be called and that the cell selection delegate methods such as shinobiGrid:didSelectCellAtCoord: will be called after this method.

Declared In

SGridDelegate.h