The status of the connection
- iOS 9.0+
- macOS 10.11+
- UIKit for Mac 13.0+Beta
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.