---
title: "toggleAutomaticLinkDetection(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextview/toggleautomaticlinkdetection(_:)"
---

# toggleAutomaticLinkDetection(_:)

Changes the state of automatic link detection from enabled to disabled and vice versa.

## Declaration

```swift
func toggleAutomaticLinkDetection(_ sender: Any?)
```

## Parameters

- `sender`: The control sending the message; may be nil.

## Discussion

Discussion Automatic link detection causes strings representing URLs typed in the view to be automatically made into links to those URLs.

## See Also

### Related Documentation

- [url(at:effectiveRange:)](foundation/nsattributedstring/url(at:effectiverange:).md)

### Setting behavioral attributes

- [allowsUndo](appkit/nstextview/allowsundo.md)
- [isEditable](appkit/nstextview/iseditable.md)
- [isSelectable](appkit/nstextview/isselectable.md)
- [isFieldEditor](appkit/nstextview/isfieldeditor.md)
- [isRichText](appkit/nstextview/isrichtext.md)
- [importsGraphics](appkit/nstextview/importsgraphics.md)
- [setBaseWritingDirection(_:range:)](appkit/nstextview/setbasewritingdirection(_:range:).md)
- [defaultParagraphStyle](appkit/nstextview/defaultparagraphstyle.md)
- [outline(_:)](appkit/nstextview/outline(_:).md)
- [allowsImageEditing](appkit/nstextview/allowsimageediting.md)
- [isAutomaticQuoteSubstitutionEnabled](appkit/nstextview/isautomaticquotesubstitutionenabled.md)
- [toggleAutomaticQuoteSubstitution(_:)](appkit/nstextview/toggleautomaticquotesubstitution(_:).md)
- [isAutomaticLinkDetectionEnabled](appkit/nstextview/isautomaticlinkdetectionenabled.md)
- [displaysLinkToolTips](appkit/nstextview/displayslinktooltips.md)
- [isAutomaticTextCompletionEnabled](appkit/nstextview/isautomatictextcompletionenabled.md)
