Cancels a previously registered periodic or boundary time observer.
- iOS 4.0+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 6.0+
Upon return, the caller is guaranteed that no new time observer blocks will begin executing. Depending on the calling thread and the queue used to add the time observer, an in-flight block may continue to execute after this method returns. You can guarantee synchronous time observer removal by enqueuing the call to
remove on that queue. Alternatively, call
remove to wait for any in-flight blocks to finish executing.
The following shows a common implementation to remove a registered time observer: