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

# endEditing(_:)

Causes the view (or one of its embedded text fields) to resign the first responder status.

```
func endEditing(_ force: Bool) -> Bool
```

## Parameters

`force`

Specify <doc://com.apple.documentation/documentation/Swift/true> to force the first responder to resign, regardless of whether it wants to do so.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the view resigned the first responder status or <doc://com.apple.documentation/documentation/Swift/false> if it did not.

## Discussion

This method looks at the current view and its subview hierarchy for the text field that is currently the first responder. If it finds one, it asks that text field to resign as first responder. If the `force` parameter is set to <doc://com.apple.documentation/documentation/Swift/true>, the text field is never even asked; it is forced to resign.

---

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)