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

# init(withResolvers:mappingTransform:)

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

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

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