---
title: "MTFilter | Mobile sdk | Mobile sdk ios | Ios"
description: "Helper to construct common filter expressions without raw strings."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# MTFilter

```
public enum MTFilter
```

Helper to construct common filter expressions without raw strings.

-   `[has(_:)](#/s:11MapTilerSDK8MTFilterO3hasyAA15MTPropertyValueOSSFZ)`
    
    \[“has”, key\]
    
    #### Declaration
    
    Swift
    
    ```
    public static func has(_ key: String) -> MTPropertyValue
    ```
    
-   `[has(_:)](#/s:11MapTilerSDK8MTFilterO3hasyAA15MTPropertyValueOAA12MTFeatureKeyOFZ)`
    
    \[“has”, key\]
    
    #### Declaration
    
    Swift
    
    ```
    public static func has(_ key: MTFeatureKey) -> MTPropertyValue
    ```
    
-   `[not(_:)](#/s:11MapTilerSDK8MTFilterO3notyAA15MTPropertyValueOAFFZ)`
    
    \[“!”, filter\]
    
    #### Declaration
    
    Swift
    
    ```
    public static func not(_ filter: MTPropertyValue) -> MTPropertyValue
    ```
    
-   `[eq(_:_:)](#/s:11MapTilerSDK8MTFilterO2eqyAA15MTPropertyValueOSS_AFtFZ)`
    
    \[“==”, \[“get”, key\], value\]
    
    #### Declaration
    
    Swift
    
    ```
    public static func eq(_ key: String, _ value: MTPropertyValue) -> MTPropertyValue
    ```
    
-   `[eq(_:_:)](#/s:11MapTilerSDK8MTFilterO2eqyAA15MTPropertyValueOAA12MTFeatureKeyO_AFtFZ)`
    
    \[“==”, \[“get”, key\], value\]
    
    #### Declaration
    
    Swift
    
    ```
    public static func eq(_ key: MTFeatureKey, _ value: MTPropertyValue) -> MTPropertyValue
    ```
    
-   `[all(_:)](#/s:11MapTilerSDK8MTFilterO3allyAA15MTPropertyValueOSayAFGFZ)`
    
    \[“all”, …filters\]
    
    #### Declaration
    
    Swift
    
    ```
    public static func all(_ filters: [MTPropertyValue]) -> MTPropertyValue
    ```
    
-   `[any(_:)](#/s:11MapTilerSDK8MTFilterO3anyyAA15MTPropertyValueOSayAFGFZ)`
    
    \[“any”, …filters\]
    
    #### Declaration
    
    Swift
    
    ```
    public static func any(_ filters: [MTPropertyValue]) -> MTPropertyValue
    ```
    
-   `[clusters()](#/s:11MapTilerSDK8MTFilterO8clustersAA15MTPropertyValueOyFZ)`
    
    Convenience: filter for clusters (features having point\_count)
    
    #### Declaration
    
    Swift
    
    ```
    static func clusters() -> MTPropertyValue
    ```
    
-   `[unclustered()](#/s:11MapTilerSDK8MTFilterO11unclusteredAA15MTPropertyValueOyFZ)`
    
    Convenience: filter for non-clustered points (!\[has point\_count\])
    
    #### Declaration
    
    Swift
    
    ```
    static func unclustered() -> MTPropertyValue
    ```
