Interface UITableViewDelegate

    • Method Detail

      • indexPathForPreferredFocusedViewInTableView

        @Nullable
        default @Nullable NSIndexPath indexPathForPreferredFocusedViewInTableView​(@NotNull
                                                                                  @NotNull UITableView tableView)
        API-Since: 9.0
      • tableViewAccessoryButtonTappedForRowWithIndexPath

        default void tableViewAccessoryButtonTappedForRowWithIndexPath​(@NotNull
                                                                       @NotNull UITableView tableView,
                                                                       @NotNull
                                                                       @NotNull NSIndexPath indexPath)
      • tableViewAccessoryTypeForRowWithIndexPath

        @Deprecated
        default long tableViewAccessoryTypeForRowWithIndexPath​(@NotNull
                                                               @NotNull UITableView tableView,
                                                               @NotNull
                                                               @NotNull NSIndexPath indexPath)
        Deprecated.
        Accessories (disclosures). API-Since: 2.0 Deprecated-Since: 3.0
      • tableViewCanFocusRowAtIndexPath

        default boolean tableViewCanFocusRowAtIndexPath​(@NotNull
                                                        @NotNull UITableView tableView,
                                                        @NotNull
                                                        @NotNull NSIndexPath indexPath)
        Focus API-Since: 9.0
      • tableViewCanPerformActionForRowAtIndexPathWithSender

        @Deprecated
        default boolean tableViewCanPerformActionForRowAtIndexPathWithSender​(@NotNull
                                                                             @NotNull UITableView tableView,
                                                                             @NotNull
                                                                             @NotNull org.moe.natj.objc.SEL action,
                                                                             @NotNull
                                                                             @NotNull NSIndexPath indexPath,
                                                                             @Nullable
                                                                             @Nullable java.lang.Object sender)
        Deprecated.
        API-Since: 5.0 Deprecated-Since: 13.0
      • tableViewDidDeselectRowAtIndexPath

        default void tableViewDidDeselectRowAtIndexPath​(@NotNull
                                                        @NotNull UITableView tableView,
                                                        @NotNull
                                                        @NotNull NSIndexPath indexPath)
        API-Since: 3.0
      • tableViewDidEndDisplayingCellForRowAtIndexPath

        default void tableViewDidEndDisplayingCellForRowAtIndexPath​(@NotNull
                                                                    @NotNull UITableView tableView,
                                                                    @NotNull
                                                                    @NotNull UITableViewCell cell,
                                                                    @NotNull
                                                                    @NotNull NSIndexPath indexPath)
        API-Since: 6.0
      • tableViewDidEndDisplayingFooterViewForSection

        default void tableViewDidEndDisplayingFooterViewForSection​(@NotNull
                                                                   @NotNull UITableView tableView,
                                                                   @NotNull
                                                                   @NotNull UIView view,
                                                                   long section)
        API-Since: 6.0
      • tableViewDidEndDisplayingHeaderViewForSection

        default void tableViewDidEndDisplayingHeaderViewForSection​(@NotNull
                                                                   @NotNull UITableView tableView,
                                                                   @NotNull
                                                                   @NotNull UIView view,
                                                                   long section)
        API-Since: 6.0
      • tableViewDidEndEditingRowAtIndexPath

        default void tableViewDidEndEditingRowAtIndexPath​(@NotNull
                                                          @NotNull UITableView tableView,
                                                          @Nullable
                                                          @Nullable NSIndexPath indexPath)
      • tableViewDidHighlightRowAtIndexPath

        default void tableViewDidHighlightRowAtIndexPath​(@NotNull
                                                         @NotNull UITableView tableView,
                                                         @NotNull
                                                         @NotNull NSIndexPath indexPath)
        API-Since: 6.0
      • tableViewDidSelectRowAtIndexPath

        default void tableViewDidSelectRowAtIndexPath​(@NotNull
                                                      @NotNull UITableView tableView,
                                                      @NotNull
                                                      @NotNull NSIndexPath indexPath)
        Called after the user changes the selection.
      • tableViewDidUnhighlightRowAtIndexPath

        default void tableViewDidUnhighlightRowAtIndexPath​(@NotNull
                                                           @NotNull UITableView tableView,
                                                           @NotNull
                                                           @NotNull NSIndexPath indexPath)
        API-Since: 6.0
      • tableViewEditActionsForRowAtIndexPath

        @Nullable
        @Deprecated
        default @Nullable NSArray<? extends UITableViewRowAction> tableViewEditActionsForRowAtIndexPath​(@NotNull
                                                                                                        @NotNull UITableView tableView,
                                                                                                        @NotNull
                                                                                                        @NotNull NSIndexPath indexPath)
        Deprecated.
        This method supersedes -tableView:titleForDeleteConfirmationButtonForRowAtIndexPath: if return value is non-nil API-Since: 8.0 Deprecated-Since: 13.0
      • tableViewEditingStyleForRowAtIndexPath

        default long tableViewEditingStyleForRowAtIndexPath​(@NotNull
                                                            @NotNull UITableView tableView,
                                                            @NotNull
                                                            @NotNull NSIndexPath indexPath)
        Allows customization of the editingStyle for a particular cell located at 'indexPath'. If not implemented, all editable cells will have UITableViewCellEditingStyleDelete set for them when the table has editing property set to YES.
      • tableViewEstimatedHeightForFooterInSection

        default double tableViewEstimatedHeightForFooterInSection​(@NotNull
                                                                  @NotNull UITableView tableView,
                                                                  long section)
        API-Since: 7.0
      • tableViewEstimatedHeightForHeaderInSection

        default double tableViewEstimatedHeightForHeaderInSection​(@NotNull
                                                                  @NotNull UITableView tableView,
                                                                  long section)
        API-Since: 7.0
      • tableViewEstimatedHeightForRowAtIndexPath

        default double tableViewEstimatedHeightForRowAtIndexPath​(@NotNull
                                                                 @NotNull UITableView tableView,
                                                                 @NotNull
                                                                 @NotNull NSIndexPath indexPath)
        Use the estimatedHeight methods to quickly calculate guessed values which will allow for fast load times of the table. If these methods are implemented, the above -tableView:heightForXXX calls will be deferred until views are ready to be displayed, so more expensive logic can be placed there. API-Since: 7.0
      • tableViewHeightForFooterInSection

        default double tableViewHeightForFooterInSection​(@NotNull
                                                         @NotNull UITableView tableView,
                                                         long section)
      • tableViewHeightForHeaderInSection

        default double tableViewHeightForHeaderInSection​(@NotNull
                                                         @NotNull UITableView tableView,
                                                         long section)
      • tableViewHeightForRowAtIndexPath

        default double tableViewHeightForRowAtIndexPath​(@NotNull
                                                        @NotNull UITableView tableView,
                                                        @NotNull
                                                        @NotNull NSIndexPath indexPath)
        Variable height support
      • tableViewIndentationLevelForRowAtIndexPath

        default long tableViewIndentationLevelForRowAtIndexPath​(@NotNull
                                                                @NotNull UITableView tableView,
                                                                @NotNull
                                                                @NotNull NSIndexPath indexPath)
        return 'depth' of row for hierarchies
      • tableViewPerformActionForRowAtIndexPathWithSender

        @Deprecated
        default void tableViewPerformActionForRowAtIndexPathWithSender​(@NotNull
                                                                       @NotNull UITableView tableView,
                                                                       @NotNull
                                                                       @NotNull org.moe.natj.objc.SEL action,
                                                                       @NotNull
                                                                       @NotNull NSIndexPath indexPath,
                                                                       @Nullable
                                                                       @Nullable java.lang.Object sender)
        Deprecated.
        API-Since: 5.0 Deprecated-Since: 13.0
      • tableViewShouldHighlightRowAtIndexPath

        default boolean tableViewShouldHighlightRowAtIndexPath​(@NotNull
                                                               @NotNull UITableView tableView,
                                                               @NotNull
                                                               @NotNull NSIndexPath indexPath)
        -tableView:shouldHighlightRowAtIndexPath: is called when a touch comes down on a row. Returning NO to that message halts the selection process and does not cause the currently selected row to lose its selected look while the touch is down. API-Since: 6.0
      • tableViewShouldIndentWhileEditingRowAtIndexPath

        default boolean tableViewShouldIndentWhileEditingRowAtIndexPath​(@NotNull
                                                                        @NotNull UITableView tableView,
                                                                        @NotNull
                                                                        @NotNull NSIndexPath indexPath)
        Controls whether the background is indented while editing. If not implemented, the default is YES. This is unrelated to the indentation level below. This method only applies to grouped style table views.
      • tableViewShouldShowMenuForRowAtIndexPath

        @Deprecated
        default boolean tableViewShouldShowMenuForRowAtIndexPath​(@NotNull
                                                                 @NotNull UITableView tableView,
                                                                 @NotNull
                                                                 @NotNull NSIndexPath indexPath)
        Deprecated.
        Copy/Paste. All three methods must be implemented by the delegate. API-Since: 5.0 Deprecated-Since: 13.0
      • tableViewShouldUpdateFocusInContext

        default boolean tableViewShouldUpdateFocusInContext​(@NotNull
                                                            @NotNull UITableView tableView,
                                                            @NotNull
                                                            @NotNull UITableViewFocusUpdateContext context)
        API-Since: 9.0
      • tableViewTargetIndexPathForMoveFromRowAtIndexPathToProposedIndexPath

        @NotNull
        default @NotNull NSIndexPath tableViewTargetIndexPathForMoveFromRowAtIndexPathToProposedIndexPath​(@NotNull
                                                                                                          @NotNull UITableView tableView,
                                                                                                          @NotNull
                                                                                                          @NotNull NSIndexPath sourceIndexPath,
                                                                                                          @NotNull
                                                                                                          @NotNull NSIndexPath proposedDestinationIndexPath)
        Allows customization of the target row for a particular row as it is being moved/reordered
      • tableViewTitleForDeleteConfirmationButtonForRowAtIndexPath

        @Nullable
        default @Nullable java.lang.String tableViewTitleForDeleteConfirmationButtonForRowAtIndexPath​(@NotNull
                                                                                                      @NotNull UITableView tableView,
                                                                                                      @NotNull
                                                                                                      @NotNull NSIndexPath indexPath)
        API-Since: 3.0
      • tableViewViewForFooterInSection

        @Nullable
        default @Nullable UIView tableViewViewForFooterInSection​(@NotNull
                                                                 @NotNull UITableView tableView,
                                                                 long section)
        custom view for footer. will be adjusted to default or specified footer height
      • tableViewViewForHeaderInSection

        @Nullable
        default @Nullable UIView tableViewViewForHeaderInSection​(@NotNull
                                                                 @NotNull UITableView tableView,
                                                                 long section)
        custom view for header. will be adjusted to default or specified header height
      • tableViewWillBeginEditingRowAtIndexPath

        default void tableViewWillBeginEditingRowAtIndexPath​(@NotNull
                                                             @NotNull UITableView tableView,
                                                             @NotNull
                                                             @NotNull NSIndexPath indexPath)
        The willBegin/didEnd methods are called whenever the 'editing' property is automatically changed by the table (allowing insert/delete/move). This is done by a swipe activating a single row
      • tableViewWillDeselectRowAtIndexPath

        @Nullable
        default @Nullable NSIndexPath tableViewWillDeselectRowAtIndexPath​(@NotNull
                                                                          @NotNull UITableView tableView,
                                                                          @NotNull
                                                                          @NotNull NSIndexPath indexPath)
        API-Since: 3.0
      • tableViewWillDisplayCellForRowAtIndexPath

        default void tableViewWillDisplayCellForRowAtIndexPath​(@NotNull
                                                               @NotNull UITableView tableView,
                                                               @NotNull
                                                               @NotNull UITableViewCell cell,
                                                               @NotNull
                                                               @NotNull NSIndexPath indexPath)
        Display customization
      • tableViewWillDisplayFooterViewForSection

        default void tableViewWillDisplayFooterViewForSection​(@NotNull
                                                              @NotNull UITableView tableView,
                                                              @NotNull
                                                              @NotNull UIView view,
                                                              long section)
        API-Since: 6.0
      • tableViewWillDisplayHeaderViewForSection

        default void tableViewWillDisplayHeaderViewForSection​(@NotNull
                                                              @NotNull UITableView tableView,
                                                              @NotNull
                                                              @NotNull UIView view,
                                                              long section)
        API-Since: 6.0
      • tableViewWillSelectRowAtIndexPath

        @Nullable
        default @Nullable NSIndexPath tableViewWillSelectRowAtIndexPath​(@NotNull
                                                                        @NotNull UITableView tableView,
                                                                        @NotNull
                                                                        @NotNull NSIndexPath indexPath)
        Called before the user changes the selection. Return a new indexPath, or nil, to change the proposed selection.
      • tableViewLeadingSwipeActionsConfigurationForRowAtIndexPath

        @Nullable
        default @Nullable UISwipeActionsConfiguration tableViewLeadingSwipeActionsConfigurationForRowAtIndexPath​(@NotNull
                                                                                                                 @NotNull UITableView tableView,
                                                                                                                 @NotNull
                                                                                                                 @NotNull NSIndexPath indexPath)
        Swipe actions These methods supersede -editActionsForRowAtIndexPath: if implemented return nil to get the default swipe actions API-Since: 11.0
      • tableViewShouldSpringLoadRowAtIndexPathWithContext

        default boolean tableViewShouldSpringLoadRowAtIndexPathWithContext​(@NotNull
                                                                           @NotNull UITableView tableView,
                                                                           @NotNull
                                                                           @NotNull NSIndexPath indexPath,
                                                                           @NotNull
                                                                           @NotNull UISpringLoadedInteractionContext context)
        Allows opting-out of spring loading for an particular row. If you want the interaction effect on a different subview of the spring loaded cell, modify the context.targetView property. The default is the cell. If this method is not implemented, the default is YES except when the row is part of a drag session. API-Since: 11.0
      • tableViewTrailingSwipeActionsConfigurationForRowAtIndexPath

        @Nullable
        default @Nullable UISwipeActionsConfiguration tableViewTrailingSwipeActionsConfigurationForRowAtIndexPath​(@NotNull
                                                                                                                  @NotNull UITableView tableView,
                                                                                                                  @NotNull
                                                                                                                  @NotNull NSIndexPath indexPath)
        API-Since: 11.0
      • tableViewContextMenuConfigurationForRowAtIndexPathPoint

        @Nullable
        default @Nullable UIContextMenuConfiguration tableViewContextMenuConfigurationForRowAtIndexPathPoint​(@NotNull
                                                                                                             @NotNull UITableView tableView,
                                                                                                             @NotNull
                                                                                                             @NotNull NSIndexPath indexPath,
                                                                                                             CGPoint point)
        Called when the interaction begins.
        Parameters:
        tableView - This UITableView.
        indexPath - IndexPath of the row for which a configuration is being requested.
        point - Location of the interaction in the table view's coordinate space
        Returns:
        A UIContextMenuConfiguration describing the menu to be presented. Return nil to prevent the interaction from beginning. Returning an empty configuration causes the interaction to begin then fail with a cancellation effect. You might use this to indicate to users that it's possible for a menu to be presented from this element, but that there are no actions to present at this particular time. API-Since: 13.0
      • tableViewDidBeginMultipleSelectionInteractionAtIndexPath

        default void tableViewDidBeginMultipleSelectionInteractionAtIndexPath​(@NotNull
                                                                              @NotNull UITableView tableView,
                                                                              @NotNull
                                                                              @NotNull NSIndexPath indexPath)
        Called right after the multi-select pan gesture begins and the table view is automatically transitioned into editing mode. In your app, this would be a good opportunity to update the state of your UI to reflect the fact that the user is now selecting multiple items at once; such as updating buttons to say "Done" instead of "Select"/"Edit", for instance. API-Since: 13.0
      • tableViewPreviewForDismissingContextMenuWithConfiguration

        @Nullable
        default @Nullable UITargetedPreview tableViewPreviewForDismissingContextMenuWithConfiguration​(@NotNull
                                                                                                      @NotNull UITableView tableView,
                                                                                                      @NotNull
                                                                                                      @NotNull UIContextMenuConfiguration configuration)
        Called when the interaction is about to dismiss. Return a UITargetedPreview describing the desired dismissal target. The interaction will animate the presented menu to the target. Use this to customize the dismissal animation.
        Parameters:
        tableView - This UITableView.
        configuration - The configuration of the menu displayed by this interaction. API-Since: 13.0
      • tableViewPreviewForHighlightingContextMenuWithConfiguration

        @Nullable
        default @Nullable UITargetedPreview tableViewPreviewForHighlightingContextMenuWithConfiguration​(@NotNull
                                                                                                        @NotNull UITableView tableView,
                                                                                                        @NotNull
                                                                                                        @NotNull UIContextMenuConfiguration configuration)
        Called when the interaction begins. Return a UITargetedPreview to override the default preview created by the table view.
        Parameters:
        tableView - This UITableView.
        configuration - The configuration of the menu about to be displayed by this interaction. API-Since: 13.0
      • tableViewShouldBeginMultipleSelectionInteractionAtIndexPath

        default boolean tableViewShouldBeginMultipleSelectionInteractionAtIndexPath​(@NotNull
                                                                                    @NotNull UITableView tableView,
                                                                                    @NotNull
                                                                                    @NotNull NSIndexPath indexPath)
        Allows a two-finger pan gesture to automatically transition the table view into editing mode and start selecting cells. If this method returns YES, allow the user to start selecting multiple contiguous cells via a two-finger pan gesture. If the table view is already in editing mode, the user can also select multiple cells via a one-finger pan gesture along the edge of the table that contains editing controls (checkboxes). In order to support this behavior, you must also set allowsMultipleSelectionDuringEditing to YES. If this method is not implemented, the default is NO. API-Since: 13.0
      • tableViewWillPerformPreviewActionForMenuWithConfigurationAnimator

        default void tableViewWillPerformPreviewActionForMenuWithConfigurationAnimator​(@NotNull
                                                                                       @NotNull UITableView tableView,
                                                                                       @NotNull
                                                                                       @NotNull UIContextMenuConfiguration configuration,
                                                                                       @NotNull
                                                                                       @NotNull UIContextMenuInteractionCommitAnimating animator)
        Called when the interaction is about to "commit" in response to the user tapping the preview.
        Parameters:
        tableView - This UITableView.
        configuration - Configuration of the currently displayed menu.
        animator - Commit animator. Add animations to this object to run them alongside the commit transition. API-Since: 13.0
      • tableViewDidEndMultipleSelectionInteraction

        default void tableViewDidEndMultipleSelectionInteraction​(@NotNull
                                                                 @NotNull UITableView tableView)
        Called when the multi-select interaction ends. At this point, the table view will remain in multi-select mode, but this delegate method is called to indicate that the multiple selection gesture or hardware keyboard interaction has ended. API-Since: 13.0
      • tableViewWillDisplayContextMenuWithConfigurationAnimator

        default void tableViewWillDisplayContextMenuWithConfigurationAnimator​(@NotNull
                                                                              @NotNull UITableView tableView,
                                                                              @NotNull
                                                                              @NotNull UIContextMenuConfiguration configuration,
                                                                              @Nullable
                                                                              @Nullable UIContextMenuInteractionAnimating animator)
        Called when the table view is about to display a menu.
        Parameters:
        tableView - This UITableView.
        configuration - The configuration of the menu about to be displayed.
        animator - Appearance animator. Add animations to run them alongside the appearance transition. API-Since: 14.0
      • tableViewWillEndContextMenuInteractionWithConfigurationAnimator

        default void tableViewWillEndContextMenuInteractionWithConfigurationAnimator​(@NotNull
                                                                                     @NotNull UITableView tableView,
                                                                                     @NotNull
                                                                                     @NotNull UIContextMenuConfiguration configuration,
                                                                                     @Nullable
                                                                                     @Nullable UIContextMenuInteractionAnimating animator)
        Called when the table view's context menu interaction is about to end.
        Parameters:
        tableView - This UITableView.
        configuration - Ending configuration.
        animator - Disappearance animator. Add animations to run them alongside the disappearance transition. API-Since: 14.0
      • tableViewSelectionFollowsFocusForRowAtIndexPath

        default boolean tableViewSelectionFollowsFocusForRowAtIndexPath​(@NotNull
                                                                        @NotNull UITableView tableView,
                                                                        @NotNull
                                                                        @NotNull NSIndexPath indexPath)
        Determines if the row at the specified index path should also become selected when focus moves to it. If the table view's global selectionFollowsFocus is enabled, this method will allow you to override that behavior on a per-index path basis. This method is not called if selectionFollowsFocus is disabled. API-Since: 15.0
      • tableViewCanPerformPrimaryActionForRowAtIndexPath

        default boolean tableViewCanPerformPrimaryActionForRowAtIndexPath​(@NotNull
                                                                          @NotNull UITableView tableView,
                                                                          @NotNull
                                                                          @NotNull NSIndexPath indexPath)
        Called to determine if a primary action can be performed for the row at the given indexPath. See @c tableView:performPrimaryActionForRowAtIndexPath: for more details about primary actions.
        Parameters:
        tableView - This UITableView
        indexPath - NSIndexPath of the row
        Returns:
        `YES` if the primary action can be performed; otherwise `NO`. If not implemented defaults to `YES` when not editing and `NO` when editing. API-Since: 16.0
      • tableViewPerformPrimaryActionForRowAtIndexPath

        default void tableViewPerformPrimaryActionForRowAtIndexPath​(@NotNull
                                                                    @NotNull UITableView tableView,
                                                                    @NotNull
                                                                    @NotNull NSIndexPath indexPath)
        Called when the primary action should be performed for the row at the given indexPath. Primary actions allow you to distinguish between a change of selection (which can be based on focus changes or other indirect selection changes) and distinct user actions. Primary actions are performed when the user selects a cell without extending an existing selection. This is called after @c willSelectRow and @c didSelectRow , regardless of whether the cell's selection state was allowed to change. As an example, use @c didSelectRowAtIndexPath for updating state in the current view controller (i.e. buttons, title, etc) and use the primary action for navigation or showing another split view column.
        Parameters:
        tableView - This UITableView
        indexPath - NSIndexPath of the row to perform the action on API-Since: 16.0