<!--
{
  "availability" : [
    "macOS: 12.0.0 -",
    "tvOS: 14.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/EnvironmentValues/resetFocus",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI17EnvironmentValuesVAAE10resetFocusAA05ResetF6ActionVvp"
  },
  "title" : "resetFocus"
}
-->

# resetFocus

An action that requests the focus system to reevaluate default focus.

```
var resetFocus: ResetFocusAction { get }
```

## Discussion

Get this environment value and call and call it as a function to force
a default focus reevaluation at runtime.

```
@Namespace var mainNamespace
@Environment(\.resetFocus) var resetFocus

var body: some View {
    // ...
    resetFocus(in: mainNamespace)
    // ...
}
```

---

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)