invalidate()
Stops the session.
Declaration
func invalidate()Mentioned in
Discussion
This method stops a running session. If you’ve scheduled a session, it cancels the session. If the session isn’t yet running or scheduled, this method triggers a WKExtendedRuntimeSessionErrorCode.notYetStarted error.
For sessions started with start(at:), you can only call invalidate() when the app is active. For all other sessions, you can call invalidate() to end a session at any time.
After calling invalidate(), you can no longer run the session. Create and start a new session instead.