<!--
{
  "availability" : [
    "iOS: 27.3.0 -",
    "iPadOS: 27.3.0 -",
    "macCatalyst: 27.3.0 -",
    "macOS: 27.3.0 -",
    "tvOS: 27.3.0 -",
    "visionOS: 27.3.0 -",
    "watchOS: 27.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntentsTesting",
  "identifier" : "/documentation/AppIntentsTesting/AppIntentExpectation/result(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "App Intents Testing"
    ],
    "preciseIdentifier" : "s:17AppIntentsTesting0A17IntentExpectationV6resultyAcA0d5ValueE0_pSgF"
  },
  "title" : "result(_:)"
}
-->

# result(_:)

Returns an intent expectation that also requires the intent’s result to
satisfy the value expectation you specify.

```
func result(_ resultExpectation: (any IntentValueExpectation)?) -> AppIntentExpectation
```

## Parameters

`resultExpectation`

The value expectation for the intent’s
result. Pass [`isNil`](/documentation/AppIntentsTesting/IntentValueExpectation/isNil) to expect no result, or
`nil` to leave the result unchecked.

## Return Value

An intent expectation that checks the same parameters and
uses `resultExpectation` for the result, replacing any earlier result
expectation.

## Discussion

Call this method after [`expect`](/documentation/AppIntentsTesting/AppIntentDefinition/expect) to check an
intent’s parameters and its result together:

```swift
let expectation = createEventIntentDefinition
    .expect(title: .contains("NASA"))
    .result(eventEntityDefinition)
```

---

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)