Instance Method

schedule(in:forMode:)

Adds the receiver to the specified run loop.

Declaration

func schedule(in aRunLoop: RunLoop, forMode mode: RunLoop.Mode)

Parameters

runLoop

Run loop in which to schedule the receiver.

runLoopMode

Run loop mode in which to perform this operation, such as default. See the Run Loop Modes section of the RunLoop class for other run loop mode values.

Discussion

You can use this method in conjunction with remove(from:forMode:) to transfer the receiver to a run loop other than the default one. You should not attempt to run the receiver on multiple run loops.

See Also

Managing Run Loops

func remove(from: RunLoop, forMode: RunLoop.Mode)

Removes the receiver from the specified run loop.