<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/inputText(_:key:modifiers:client:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Objective-C Runtime",
      "ObjectiveC"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(im)inputText:key:modifiers:client:"
  },
  "title" : "inputText(_:key:modifiers:client:)"
}
-->

# inputText(_:key:modifiers:client:)

Receives Unicode, the key code that generated it, and any modifier flags.

```
func inputText(_ string: String!, key keyCode: Int, modifiers flags: Int, client sender: Any!) -> Bool
```

## Parameters

`string`

The text input by the client.

`keyCode`

The key code for the associated Unicode.

`flags`

The modifier flags.

`sender`

The client object.

## Return Value

[`YES`](/documentation/ObjectiveC/YES) if the input is  accepted; otherwise [`NO`](/documentation/ObjectiveC/NO).

---

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)