<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/ContainsComparator/init(withResolvers:mappingTransform:)-7vx0d",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents18ContainsComparatorC13withResolvers16mappingTransformACyxq_q0_q1_Gqd__yc_q1_q0_ctcs23ExpressibleByNilLiteralR_SQR0_13UnwrappedTypeAA12_IntentValueP_7ElementSTQY_Rs0_AA21ResolverSpecificationRd__AA09_SequenceoP0AhJRp_STAORQlufc"
  },
  "title" : "init(withResolvers:mappingTransform:)"
}
-->

# init(withResolvers:mappingTransform:)

Declares support for the `contains` operator between an optional `Array` property and user-supplied values.

```
init<Spec>(@ResolverSpecificationBuilder<PropertyType.UnwrappedType> withResolvers resolvers: @escaping () -> Spec, mappingTransform: @escaping (InputType) -> ComparatorMappingType) where PropertyType : ExpressibleByNilLiteral, InputType : Equatable, InputType == PropertyType.UnwrappedType.Element, Spec : ResolverSpecification, PropertyType.UnwrappedType : _SequenceIntentValue, PropertyType.UnwrappedType : Sequence
```

## Parameters

`resolvers`

Set of `Resolver`s to apply when converting user input to the target `Value` type.

`mappingTransform`

Closure that transforms the user-supplied value into the `ComparatorMappingType` output type.

---

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)