테이블 뷰에서 셀렉션 관리, 섹션 헤더 및 푸터 구성, 셀 삭제 및 재정렬, 기타 등의 작업을 수행하는 메서드들
@MainActor protocol UITableViewDelegate
이 프로토콜의 메소드를 사용하여 다음 기능을 관리합니다.
테이블뷰는 NSIndexPath
객체를 사용하여 행과 섹션을 지정합니다. 행 및 섹션 인덱스를 해석하는 방법에 대한 자세한 내용은 Specifying the Location of Rows and Sections을 참조하세요.
func tableView(UITableView, willDisplay: UITableViewCell, forRowAt: IndexPath)
func tableView(UITableView, indentationLevelForRowAt: IndexPath) -> Int
func tableView(UITableView, shouldSpringLoadRowAt: IndexPath, with: UISpringLoadedInteractionContext) -> Bool
Handling Row Selection in a Table View
Selecting Multiple Items with a Two-Finger Pan Gesture
func tableView(UITableView, willSelectRowAt: IndexPath) -> IndexPath?
func tableView(UITableView, didSelectRowAt: IndexPath)
func tableView(UITableView, willDeselectRowAt: IndexPath) -> IndexPath?
func tableView(UITableView, didDeselectRowAt: IndexPath)
func tableView(UITableView, shouldBeginMultipleSelectionInteractionAt: IndexPath) -> Bool
func tableView(UITableView, didBeginMultipleSelectionInteractionAt: IndexPath)
func tableViewDidEndMultipleSelectionInteraction(UITableView)
func tableView(UITableView, viewForHeaderInSection: Int) -> UIView?
func tableView(UITableView, viewForFooterInSection: Int) -> UIView?
func tableView(UITableView, willDisplayHeaderView: UIView, forSection: Int)
func tableView(UITableView, willDisplayFooterView: UIView, forSection: Int)
func tableView(UITableView, heightForRowAt: IndexPath) -> CGFloat
func tableView(UITableView, heightForHeaderInSection: Int) -> CGFloat
func tableView(UITableView, heightForFooterInSection: Int) -> CGFloat
class let automaticDimension: CGFloat
func tableView(UITableView, estimatedHeightForRowAt: IndexPath) -> CGFloat
func tableView(UITableView, estimatedHeightForHeaderInSection: Int) -> CGFloat
func tableView(UITableView, estimatedHeightForFooterInSection: Int) -> CGFloat
func tableView(UITableView, accessoryButtonTappedForRowWith: IndexPath)
Adding Context Menus in Your App
func tableView(UITableView, contextMenuConfigurationForRowAt: IndexPath, point: CGPoint) -> UIContextMenuConfiguration?
func tableView(UITableView, previewForDismissingContextMenuWithConfiguration: UIContextMenuConfiguration) -> UITargetedPreview?
func tableView(UITableView, previewForHighlightingContextMenuWithConfiguration: UIContextMenuConfiguration) -> UITargetedPreview?
func tableView(UITableView, willDisplayContextMenu: UIContextMenuConfiguration, animator: UIContextMenuInteractionAnimating?)
func tableView(UITableView, willEndContextMenuInteraction: UIContextMenuConfiguration, animator: UIContextMenuInteractionAnimating?)
func tableView(UITableView, willPerformPreviewActionForMenuWith: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating)
func tableView(UITableView, leadingSwipeActionsConfigurationForRowAt: IndexPath) -> UISwipeActionsConfiguration?
func tableView(UITableView, trailingSwipeActionsConfigurationForRowAt: IndexPath) -> UISwipeActionsConfiguration?
func tableView(UITableView, shouldHighlightRowAt: IndexPath) -> Bool
Asks the delegate if the specified row should be highlighted.
func tableView(UITableView, didHighlightRowAt: IndexPath)
Tells the delegate that the specified row was highlighted.
func tableView(UITableView, didUnhighlightRowAt: IndexPath)
Tells the delegate that the highlight was removed from the row at the specified index path.
Editing Table Rows
func tableView(UITableView, willBeginEditingRowAt: IndexPath)
Tells the delegate that the table view is about to go into editing mode.
func tableView(UITableView, didEndEditingRowAt: IndexPath?)
Tells the delegate that the table view has left editing mode.
func tableView(UITableView, editingStyleForRowAt: IndexPath) -> UITableViewCell.EditingStyle
Asks the delegate for the editing style of a row at a particular location in a table view.
func tableView(UITableView, titleForDeleteConfirmationButtonForRowAt: IndexPath) -> String?
Changes the default title of the delete-confirmation button.
func tableView(UITableView, shouldIndentWhileEditingRowAt: IndexPath) -> Bool
Asks the delegate whether the background of the specified row should be indented while the table view is in editing mode.
Reordering Table Rows
func tableView(UITableView, targetIndexPathForMoveFromRowAt: IndexPath, toProposedIndexPath: IndexPath) -> IndexPath
Asks the delegate to return a new index path to retarget a proposed move of a row.
Tracking the Removal of Views
func tableView(UITableView, didEndDisplaying: UITableViewCell, forRowAt: IndexPath)
Tells the delegate that the specified cell was removed from the table.
func tableView(UITableView, didEndDisplayingHeaderView: UIView, forSection: Int)
Tells the delegate that the specified header view was removed from the table.
func tableView(UITableView, didEndDisplayingFooterView: UIView, forSection: Int)
Tells the delegate that the specified footer view was removed from the table.
Managing Table View Focus
func tableView(UITableView, canFocusRowAt: IndexPath) -> Bool
Asks the delegate whether the cell at the specified index path is itself focusable.
func tableView(UITableView, shouldUpdateFocusIn: UITableViewFocusUpdateContext) -> Bool
Asks the delegate whether the focus update specified by the context is allowed to occur.
func tableView(UITableView, didUpdateFocusIn: UITableViewFocusUpdateContext, with: UIFocusAnimationCoordinator)
Tells the delegate that a focus update specified by the context has just occurred.
func indexPathForPreferredFocusedView(in: UITableView) -> IndexPath?
Asks the delegate for the table view’s index path for the preferred focused view.
Instance Methods
func tableView(UITableView, selectionFollowsFocusForRowAt: IndexPath) -> Bool
Asks the delegate whether to relate selection and focus behavior for the row at the corresponding index path.
Beta