invalidate()
Stops a running session.
Declaration
func invalidate()Discussion
When an app calls this function, NI invokes session(_:didRemove:reason:) on the peer’s side and passes in the reason NINearbyObject.RemovalReason.peerEnded. The app can’t restart invalid sessions.