<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextInputDelegate/selectionWillChange(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITextInputDelegate(im)selectionWillChange:"
  },
  "title" : "selectionWillChange(_:)"
}
-->

# selectionWillChange(_:)

Tells the input delegate when the selection is about to change in the document.

```
func selectionWillChange(_ textInput: (any UITextInput)?)
```

## Parameters

`textInput`

The document instance whose class adopts the UITextInput protocol.

## See Also

[`textWillChange(_:)`](/documentation/UIKit/UITextInputDelegate/textWillChange(_:))

Tells the input delegate when text is about to change in the document.



---

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)