The status of the connection
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
Use Key-Value Observing (KVO) to monitor the state. Many methods, such as reading and writing on the connection, are only valid when the state is
NWTCPConnection. For information about KVO, see Key-Value Observing Programming Guide.