Adds a port as an input source to the specified mode of the run loop.
- iOS 2.0+
- macOS 10.0+
- UIKit for Mac 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The port to add to the receiver.
The mode in which to add
a. You may specify a custom mode or use one of the modes listed in Run Loop Modes.
This method schedules the port with the receiver. You can add a port to multiple input modes. When the receiver is running in the specified mode, it dispatches messages destined for that port to the port’s designated handler routine.