---
title: "init(withResolvers:mappingTransform:)"
framework: appintents
role: symbol
role_heading: Initializer
path: "appintents/containscomparator/init(withresolvers:mappingtransform:)-7vx0d"
---

# init(withResolvers:mappingTransform:)

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

## Declaration

```swift
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 Resolvers to apply when converting user input to the target Value type.
- `mappingTransform`: Closure that transforms the user-supplied value into the ComparatorMappingType output type.
