---
title: "init(withResolvers:mappingTransform:)"
framework: appintents
role: symbol
role_heading: Initializer
path: "appintents/hasprefixcomparator/init(withresolvers:mappingtransform:)-2n67a"
---

# init(withResolvers:mappingTransform:)

Declares support for the hasPrefix operator between a String property and user-supplied values.

## Declaration

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

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

## See Also

### Creating a comparator

- [init(mappingTransform:)](appintents/hasprefixcomparator/init(mappingtransform:)-4i1bf.md)
- [init(mappingTransform:)](appintents/hasprefixcomparator/init(mappingtransform:)-5kri6.md)
- [init(withResolvers:mappingTransform:)](appintents/hasprefixcomparator/init(withresolvers:mappingtransform:)-48o75.md)
