<!--
{
  "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/HasSuffixComparator",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents19HasSuffixComparatorC"
  },
  "title" : "HasSuffixComparator"
}
-->

# HasSuffixComparator

An object that determines whether the value of a string property has the specified suffix.

```
final class HasSuffixComparator<Property, PropertyType, InputType, ComparatorMappingType> where Property : EntityProperty<PropertyType>, PropertyType : _IntentValue, PropertyType : Sendable, InputType : _IntentValue
```

## Topics

### Creating a comparator

[`init(mappingTransform: (InputType) -> ComparatorMappingType)`](/documentation/AppIntents/HasSuffixComparator/init(mappingTransform:)-4dp26)

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

[`init(mappingTransform: (InputType) -> ComparatorMappingType)`](/documentation/AppIntents/HasSuffixComparator/init(mappingTransform:)-5cmgi)

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

[`init<Spec>(withResolvers: () -> Spec, mappingTransform: (InputType) -> ComparatorMappingType)`](/documentation/AppIntents/HasSuffixComparator/init(withResolvers:mappingTransform:)-5rtmw)

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

[`init<Spec>(withResolvers: () -> Spec, mappingTransform: (InputType) -> ComparatorMappingType)`](/documentation/AppIntents/HasSuffixComparator/init(withResolvers:mappingTransform:)-7tdan)

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

## Relationships

### Inherits From

[`EntityQueryComparator`](/documentation/AppIntents/EntityQueryComparator)

---

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)