Contents

encodeRestorableState(with:backgroundQueue:)

Saves the interface-related state of the responder to a keyed archiver either synchronously or asynchronously on the given operation queue.

Declaration

func encodeRestorableState(with coder: NSCoder, backgroundQueue queue: OperationQueue)

Parameters

  • coder:

    A thread-safe keyed archiver to write restorable state into.

  • queue:

    A serial background operation queue to perform asynchronous encoding work on.

Discussion

Don’t call this method directly. The system calls this method on the main thread. The receiver may synchronously encode state to coder or may enqueue asynchronous work to encode additional restorable state using the provided serial background OperationQueue, if it can safely access and encode that information. The encoding process finishes when the enqueued operations complete.

If you override this method, call the super implementation.

See Also

Handling Window Restoration