<!--
{
  "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:)-5j3ie",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents18ContainsComparatorC13withResolvers16mappingTransformACyxq_SSq1_Gqd__yc_q1_SSctcs23ExpressibleByNilLiteralR_SSRs0_AA21ResolverSpecificationRd__SS13UnwrappedTypeAA12_IntentValuePRt_lufc"
  },
  "title" : "init(withResolvers:mappingTransform:)"
}
-->

# init(withResolvers:mappingTransform:)

Declares support for the `contains` operator between a `String?` property and user-supplied values.

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

## 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)