iOS Guides | Samples

MonoTouch.UIKit.UITableViewSource Class

Joint UITableViewDataSource and UITableViewDelegate base class. Preferred way to provide data and handle lifecycle events for UITableViews.

See Also: UITableViewSource

Syntax

[MonoTouch.Foundation.Model]
[MonoTouch.Foundation.Register("UITableViewSource", false)]
public abstract class UITableViewSource : UIScrollViewDelegate

See Also

Remarks

UITableViewSource merges both the UITableViewDataSource and the UITableViewDelegate into a single class. It is more cohesive than subclassing those independently, but there is no technical barrier to application developers working with those types directly.

Application developers must subtype this class, override the methods as necessary, and assign an instance of this object to the UITableView.Source property.

The methods merged from UITableViewDataSource provide the table view with all the information it requires to display its data - such as informing it of the number of sections and rows, and what cell view to use for each row. The methods merged from UITableViewDelegate provide the table view with the ability to manage selection, configure section headers and footers, delete and reorder cells and control the editing menu.

Requirements

Namespace: MonoTouch.UIKit
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0

The members of MonoTouch.UIKit.UITableViewSource are listed below.

See Also: UIScrollViewDelegate

Public Constructors

Default constructor that initializes a new instance of this class with no parameters.
A constructor that initializes the object from the data stored in the unarchiver object.
Constructor to call on derived classes to skip initialization and merely allocate the object.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Methods

AccessoryButtonTapped(UITableView, NSIndexPath)
Called when the user taps the DetailDisclosureButton accessory on the row located at indexPath.
AccessoryForRow(UITableView, NSIndexPath) : UITableViewCellAccessory
Deprecated in iOS 3.0. Use UITableViewCell.Accessory and UITableViewCell.AccessoryView when configuring table view cells.
CanEditRow(UITableView, NSIndexPath) : Boolean
Whether the row located at indexPath should be editable.
CanFocusRow(UITableView, NSIndexPath) : Boolean
Whether the row at the specified indexPath may receive focus.
CanMoveRow(UITableView, NSIndexPath) : Boolean
Whether the row located at indexPath can be moved to another location in the table view.
CanPerformAction(UITableView, Selector, NSIndexPath, NSObject) : Boolean
Whether the editing menu should omit the Copy or Paste command for the specified row.
CellDisplayingEnded(UITableView, UITableViewCell, NSIndexPath)
Indicates that the cell at the specified indexPath has finished displaying.
CommitEditingStyle(UITableView, UITableViewCellEditingStyle, NSIndexPath)
Commits the insertion or deletion of the specified row.
CustomizeMoveTarget(UITableView, NSIndexPath, NSIndexPath) : NSIndexPath
Return a new index path to change the final location of a row being moved by the user.
override
DecelerationEnded(UIScrollView)
Called when deceleration has ended (at the end of a scrolling movement).
override
DecelerationStarted(UIScrollView)
Called when deceleration has started (at the end of a scrolling movement).
DidEndEditing(UITableView, NSIndexPath)
Called when the table view has left editing mode for the row specified by indexPath.
DidUpdateFocus(UITableView, UITableViewFocusUpdateContext, UIFocusAnimationCoordinator)
Indicates that the focus changed as detailed in the context.
override
DidZoom(UIScrollView)
Called when the table view is being zoomed.
override
DraggingEnded(UIScrollView, Boolean)
Called when dragging has ended.
override
DraggingStarted(UIScrollView)
Called when dragging is about to begin.
EditActionsForRow(UITableView, NSIndexPath) : UITableViewRowAction[]
Returns an array of row actions to display after the user swipes the row in the tableView table view that is identified by indexPath.
EditingStyleForRow(UITableView, NSIndexPath) : UITableViewCellEditingStyle
Called for each row being displayed by the table view, to determine what editing style to use for that row.
EstimatedHeight(UITableView, NSIndexPath) : Single
The estimated height of the table cell at the specified indexPath.
EstimatedHeightForFooter(UITableView, Int32) : Single
The estimated height of the footer for the specified section.
EstimatedHeightForHeader(UITableView, Int32) : Single
The estimated height of the header for the specified section.
FooterViewDisplayingEnded(UITableView, UIView, Int32)
Indicates that the footerView for the specified section is about to be removed.
abstract
GetCell(UITableView, NSIndexPath) : UITableViewCell
Called by the table view to get populate the row at indexPath with a cell view.
GetHeightForFooter(UITableView, Int32) : Single
Called to determine the height of the footer for the section specified by section.
GetHeightForHeader(UITableView, Int32) : Single
Called to determine the height of the header for the section specified by section.
GetHeightForRow(UITableView, NSIndexPath) : Single
Called to determine the height of the row at indexPath.
GetIndexPathForPreferredFocusedView(UITableView) : NSIndexPath
The index path of the table's preferred focus view.
GetViewForFooter(UITableView, Int32) : UIView
Returns a view object to display at the end of the given section.
GetViewForHeader(UITableView, Int32) : UIView
Returns a view object to display at the start of the given section.
HeaderViewDisplayingEnded(UITableView, UIView, Int32)
Called when a section header is removed from a table (for instance, due to scrolling).
IndentationLevel(UITableView, NSIndexPath) : Int32
Get the indentation level for the row specified by indexPath.
MoveRow(UITableView, NSIndexPath, NSIndexPath)
Called when a row has been moved so that the data source can 'implement' the changed row position that has been performed in the user interface. This ensures the data is kept in-sync with what is being displayed.
NumberOfSections(UITableView) : Int32
Returns the number of sections that are required to display the data.
PerformAction(UITableView, Selector, NSIndexPath, NSObject)
Called to perform a copy or paste operation on the row specified by indexPath.
RowDeselected(UITableView, NSIndexPath)
Called when the row specified by indexPath is de-selected.
RowHighlighted(UITableView, NSIndexPath)
Called when a row is highlighted.
RowSelected(UITableView, NSIndexPath)
Called when the row specified by indexPath is selected.
abstract
RowsInSection(UITableView, Int32) : Int32
Called by the table view to find out how many rows are to be rendered in the section specified by section.
RowUnhighlighted(UITableView, NSIndexPath)
Called when a row is unhighlighted.
override
ScrollAnimationEnded(UIScrollView)
Called when a scrolling animation in the scroll view is finished.
override
Scrolled(UIScrollView)
Called when the user scrolls the content.
override
ScrolledToTop(UIScrollView)
Called when the scroll view is scrolled to the top of the content.
SectionFor(UITableView, String, Int32) : Int32
Returns the index of the section with the given tableView and atIndex.
SectionIndexTitles(UITableView) : String[]
Returns an array of titles to be displayed as an index on the table view.
ShouldHighlightRow(UITableView, NSIndexPath) : Boolean
Called prior to highlighting. If this method returns false, the row will not be highlighted.
ShouldIndentWhileEditing(UITableView, NSIndexPath) : Boolean
Whether the row specified by indexPath should be indented while the table is in edit mode.
override
ShouldScrollToTop(UIScrollView) : Boolean
Called by the scroll view subclass to determine whether it should scroll to the top of the content.
ShouldShowMenu(UITableView, NSIndexPath) : Boolean
Whether the editing menu should be displayed for the row specified by indexPath.
ShouldUpdateFocus(UITableView, UITableViewFocusUpdateContext) : Boolean
Called prior to the this either losing or receiving focus. If either focus environment returns false, the focus update is canceled.
TitleForDeleteConfirmation(UITableView, NSIndexPath) : String
Sets the text of the Delete button for the specified row.
TitleForFooter(UITableView, Int32) : String
Called to populate the footer for the specified section.
TitleForHeader(UITableView, Int32) : String
Called to populate the header for the specified section.
override
ViewForZoomingInScrollView(UIScrollView) : UIView
Returns the view to scale when zooming is about to occur in the scroll view.
WillBeginEditing(UITableView, NSIndexPath)
Called when the table view is about to enter swipe-to-delete editing mode.
WillDeselectRow(UITableView, NSIndexPath) : NSIndexPath
Called prior to the de-selection of a row.
WillDisplay(UITableView, UITableViewCell, NSIndexPath)
Called just before a cell is rendered for the row specified by indexPath.
WillDisplayFooterView(UITableView, UIView, Int32)
Called prior to the display of a footer view for a section.
WillDisplayHeaderView(UITableView, UIView, Int32)
Called prior to the display of a header view for a section.
override
WillEndDragging(UIScrollView, PointF, ref PointF)
Called when the user finishes scrolling the content.
WillSelectRow(UITableView, NSIndexPath) : NSIndexPath
Called when a row is about to be selected.
override
ZoomingEnded(UIScrollView, UIView, Single)
Called when content zooming is complete.
override
ZoomingStarted(UIScrollView, UIView)
Called when a zooming operation is about to start.