Sends an interrupt signal to the receiver and all of its subtasks.
SDK
- macOS 10.0+
Framework
- Foundation
Declaration
func interrupt()
Discussion
If the task terminates as a result, which is the default behavior, an did
gets sent to the default notification center. This method has no effect if the receiver was already launched and has already finished executing. If the receiver has not been launched yet, this method raises an NSInvalid
.
It is not always possible to interrupt the receiver because it might be ignoring the interrupt signal. interrupt()
sends SIGINT
.