One Logo Pool Ball
Foundation · IOS API REFERENCE

UndoManager

class · iOS 3.0+ · SDK 27.1

@MainActor class UndoManager

Members (40)

method · iOS 3.0+

beginUndoGrouping

TypeScript
beginUndoGrouping(): Promise<void>
Swift declaration
func beginUndoGrouping()
method · iOS 3.0+

disableUndoRegistration

TypeScript
disableUndoRegistration(): Promise<void>
Swift declaration
func disableUndoRegistration()
method · iOS 3.0+

enableUndoRegistration

TypeScript
enableUndoRegistration(): Promise<void>
Swift declaration
func enableUndoRegistration()
method · iOS 3.0+

endUndoGrouping

TypeScript
endUndoGrouping(): Promise<void>
Swift declaration
func endUndoGrouping()
init

init

TypeScript
static init(): Promise<UndoManager>
Swift declaration
init()
method · iOS 3.0+

prepare

TypeScript
prepare(target: unknown): Promise<unknown>
Swift declaration
func prepare(withInvocationTarget target: Any) -> Any
method · iOS 3.0+

redo

TypeScript
redo(): Promise<void>
Swift declaration
func redo()
method · iOS 18.0+

redoActionUserInfoValue

TypeScript
redoActionUserInfoValue(key: UndoManager_UserInfoKey): Promise<(unknown) | null>
Swift declaration
func redoActionUserInfoValue(forKey key: UndoManager.UserInfoKey) -> Any?
method · iOS 3.0+

redoMenuTitle

TypeScript
redoMenuTitle(actionName: string): Promise<string>
Swift declaration
func redoMenuTitle(forUndoActionName actionName: String) -> String
method · iOS 3.0+

removeAllActions

TypeScript
removeAllActions(): Promise<void>
Swift declaration
func removeAllActions()
method · iOS 3.0+

removeAllActions

TypeScript
removeAllActionsWithTarget(target: unknown): Promise<void>
Swift declaration
func removeAllActions(withTarget target: Any)
method · iOS 5.0+

setActionIsDiscardable

TypeScript
setActionIsDiscardable(discardable: boolean): Promise<void>
Swift declaration
func setActionIsDiscardable(_ discardable: Bool)
method · iOS 3.0+

setActionName

TypeScript
setActionName(actionName: string): Promise<void>
Swift declaration
func setActionName(_ actionName: String)
method · iOS 18.0+

setActionUserInfoValue

TypeScript
setActionUserInfoValue(info: (unknown) | null, key: UndoManager_UserInfoKey): Promise<void>
Swift declaration
func setActionUserInfoValue(_ info: Any?, forKey key: UndoManager.UserInfoKey)
method · iOS 3.0+

undo

TypeScript
undo(): Promise<void>
Swift declaration
func undo()
method · iOS 18.0+

undoActionUserInfoValue

TypeScript
undoActionUserInfoValue(key: UndoManager_UserInfoKey): Promise<(unknown) | null>
Swift declaration
func undoActionUserInfoValue(forKey key: UndoManager.UserInfoKey) -> Any?
method · iOS 3.0+

undoMenuTitle

TypeScript
undoMenuTitle(actionName: string): Promise<string>
Swift declaration
func undoMenuTitle(forUndoActionName actionName: String) -> String
method · iOS 3.0+

undoNestedGroup

TypeScript
undoNestedGroup(): Promise<void>
Swift declaration
func undoNestedGroup()
get · iOS 3.0+

canRedo

TypeScript
get canRedo(): Promise<boolean>
Swift declaration
var canRedo: Bool { get }
get · iOS 3.0+

canUndo

TypeScript
get canUndo(): Promise<boolean>
Swift declaration
var canUndo: Bool { get }
get · iOS 3.0+

groupingLevel

TypeScript
get groupingLevel(): Promise<number>
Swift declaration
var groupingLevel: Int { get }
get · iOS 3.0+

groupsByEvent

TypeScript
get groupsByEvent(): Promise<boolean>
Swift declaration
var groupsByEvent: Bool { get set }
set · iOS 3.0+

groupsByEvent

TypeScript
setGroupsByEvent(value: boolean): Promise<void>
Swift declaration
var groupsByEvent: Bool { get set }
get · iOS 3.0+

levelsOfUndo

TypeScript
get levelsOfUndo(): Promise<number>
Swift declaration
var levelsOfUndo: Int { get set }
set · iOS 3.0+

levelsOfUndo

TypeScript
setLevelsOfUndo(value: number): Promise<void>
Swift declaration
var levelsOfUndo: Int { get set }
get · iOS 5.0+

redoActionIsDiscardable

TypeScript
get redoActionIsDiscardable(): Promise<boolean>
Swift declaration
var redoActionIsDiscardable: Bool { get }
get · iOS 3.0+

redoActionName

TypeScript
get redoActionName(): Promise<string>
Swift declaration
var redoActionName: String { get }
get · iOS 17.4+

redoCount

TypeScript
get redoCount(): Promise<number>
Swift declaration
var redoCount: Int { get }
get · iOS 3.0+

redoMenuItemTitle

TypeScript
get redoMenuItemTitle(): Promise<string>
Swift declaration
var redoMenuItemTitle: String { get }
get · iOS 3.0+

isRedoing

TypeScript
get isRedoing(): Promise<boolean>
Swift declaration
var isRedoing: Bool { get }
get · iOS 3.0+

runLoopModes

TypeScript
get runLoopModes(): Promise<Array<RunLoop_Mode>>
Swift declaration
var runLoopModes: [RunLoop.Mode] { get set }
set · iOS 3.0+

runLoopModes

TypeScript
setRunLoopModes(value: Array<RunLoop_Mode>): Promise<void>
Swift declaration
var runLoopModes: [RunLoop.Mode] { get set }
get · iOS 5.0+

undoActionIsDiscardable

TypeScript
get undoActionIsDiscardable(): Promise<boolean>
Swift declaration
var undoActionIsDiscardable: Bool { get }
get · iOS 3.0+

undoActionName

TypeScript
get undoActionName(): Promise<string>
Swift declaration
var undoActionName: String { get }
get · iOS 17.4+

undoCount

TypeScript
get undoCount(): Promise<number>
Swift declaration
var undoCount: Int { get }
get · iOS 3.0+

undoMenuItemTitle

TypeScript
get undoMenuItemTitle(): Promise<string>
Swift declaration
var undoMenuItemTitle: String { get }
get · iOS 3.0+

isUndoRegistrationEnabled

TypeScript
get isUndoRegistrationEnabled(): Promise<boolean>
Swift declaration
var isUndoRegistrationEnabled: Bool { get }
get · iOS 3.0+

isUndoing

TypeScript
get isUndoing(): Promise<boolean>
Swift declaration
var isUndoing: Bool { get }
method · iOS 9.0+

registerUndo

TypeScript
registerUndo(target: SDKHandle, handler: ((arg0: SDKHandle) => void)): Promise<void>
Swift declaration
@MainActor @preconcurrency func registerUndo<TargetType>(withTarget target: TargetType, handler: @escaping @MainActor (TargetType) -> Void) where TargetType : AnyObject

Registers the specified closure to implement a single undo operation that the target receives. To avoid retain cycles with the target, operate on the closure parameter rather than on variables in an outer scope that reference the same target. - Parameters: - target: The target of the undo operation. The undo manager maintains an unowned reference to the target to prevent retain cycles. - handler: A closure to execute when an operation is undone. The closure takes a single argument, the target of the undo operation.

method · iOS 16.0+

setActionName

TypeScript
setActionName72256(actionNameResource?: (LocalizedStringResource) | null): Promise<void>
Swift declaration
@MainActor @preconcurrency final func setActionName(_ actionNameResource: LocalizedStringResource?)

Sets the name of the action associated with the Undo or Redo command using a localized string resource. This version of `setActionName(_:)` takes a ``LocalizedStringResource``. When using this version, ``undoActionName``, ``redoActionName``, ``undoMenuItemTitle``, and ``redoMenuItemTitle`` interpret the provided resource using the current locale. The undo manager parses the parameter as Markdown using ``AttributedString/init(localized:)`` in order to support inflection. If `actionNameResource` is `nil`, the undo manager removes the action name currently associated with the menu command. - Parameter actionNameResource: The name of the action, as a ``LocalizedStringResource``. Pass in `nil` to reset the action name currently associated with the menu command.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

UndoManager.registerUndo(withTarget:selector:object:)

Objective-C selectors cannot cross the bridge.

All Foundation types →