<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextView/toggleAutomaticLinkDetection(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextView(im)toggleAutomaticLinkDetection:"
  },
  "title" : "toggleAutomaticLinkDetection(_:)"
}
-->

# toggleAutomaticLinkDetection(_:)

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

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

## Parameters

`sender`

The control sending the message; may be `nil`.

## Discussion

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

## See Also

  <doc://com.apple.documentation/documentation/Foundation/NSAttributedString/url(at:effectiveRange:)>



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)