Adds a mode to the set of run loop common modes.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The run loop to modify. Each run loop has its own independent list of modes that are in the set of common modes.
The run loop mode to add to the set of common modes of
Sources, timers, and observers get registered to one or more run loop modes and only run when the run loop is running in one of those modes. Common modes are a set of run loop modes for which you can define a set of sources, timers, and observers that are shared by these modes. Instead of registering a source, for example, to each specific run loop mode, you can register it once to the run loop’s common pseudo-mode and it will be automatically registered in each run loop mode in the common mode set. Likewise, when a mode is added to the set of common modes, any sources, timers, or observers already registered to the common pseudo-mode are added to the newly added common mode.
Once a mode is added to the set of common modes, it cannot be removed.
The Add, Contains, and Remove functions for sources, timers, and observers operate on a run loop’s set of common modes when you use the constant
common for the run loop mode.