---
title: invalidate()
framework: uikit
role: symbol
role_heading: Instance Method
path: uikit/uitextloupesession/invalidate()
---

# invalidate()

Hides the loupe and cleans up any session-related state.

## Declaration

```swift
func invalidate()
```

## Mentioned in

Adopting system selection UI in custom text views

## Discussion

Discussion Call this method when you’re ready to hide the loupe. After calling this method, you can remove your reference to the session.

## See Also

### Updating the loupe during the session

- [move(to:withCaretRect:trackingCaret:)](uikit/uitextloupesession/move(to:withcaretrect:trackingcaret:).md)
