---
title: "MTStyle | Mobile sdk | Mobile sdk ios | Ios"
description: "The proxy object for the current map style."
---

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

# MTStyle

```
@MainActor
public class MTStyle
```

The proxy object for the current map style.

Set of convenience methods for style, sources and layers manipulation. MTStyle is nil until map loading is complete. Since it is loaded asynchronously it should be manipulated only after `[MTEvent.didLoad](https://docs.maptiler.com/mobile-sdk/ios/api/Enums/MTEvent/#/s:11MapTilerSDK7MTEventO7didLoadyA2CmF)` triggers.

-   `[referenceStyle](#/s:11MapTilerSDK7MTStyleC14referenceStyleAA014MTMapReferenceF0Ovp)`
    
    Current reference style of the map object.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public private(set) var referenceStyle: MTMapReferenceStyle { get }
    ```
    
-   `[styleVariant](#/s:11MapTilerSDK7MTStyleC12styleVariantAA010MTMapStyleF0OSgvp)`
    
    Current style variant of the map object.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public private(set) var styleVariant: MTMapStyleVariant? { get }
    ```
    
-   `[setStyle(_:styleVariant:completionHandler:)](#/s:11MapTilerSDK7MTStyleC8setStyle_12styleVariant17completionHandleryAA014MTMapReferenceF0O_AA0kfH0OSgys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Updates the map’s style object with a new value.
    
    Setting the style resets custom sources and layers, so make sure to wait for style to load (`[styleDidUpdate](https://docs.maptiler.com/mobile-sdk/ios/api/Enums/MTEvent/#/s:11MapTilerSDK7MTEventO14styleDidUpdateyA2CmF)`) before adding them.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setStyle(
        _ referenceStyle: MTMapReferenceStyle,
        styleVariant: MTMapStyleVariant?,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>referenceStyle</em></code></td><td><div><p>Desired reference map style.</p></div></td></tr><tr><td><code><em>styleVariant</em></code></td><td><div><p>Optional variant of the reference style.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getVariantsForCurrentReferenceStyle()](#/s:11MapTilerSDK7MTStyleC35getVariantsForCurrentReferenceStyleSayAA05MTMapJ7VariantOGSgyF)`
    
    Returns variants for the current reference style if they exist.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getVariantsForCurrentReferenceStyle() -> [MTMapStyleVariant]?
    ```
    
-   `[getVariants(for:)](#/s:11MapTilerSDK7MTStyleC11getVariants3forSayAA17MTMapStyleVariantOGSgAA0h9ReferenceI0O_tF)`
    
    Returns variants for the provided reference style if they exist.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getVariants(for referenceStyle: MTMapReferenceStyle) -> [MTMapStyleVariant]?
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>referenceStyle</em></code></td><td><div><p>Reference style for which to get variants.</p></div></td></tr></tbody></table>
    
-   `[getIdForCurrentReferenceStyle(completionHandler:)](#/s:11MapTilerSDK7MTStyleC29getIdForCurrentReferenceStyle17completionHandleryys6ResultOySSAA7MTErrorOGcSg_tF)`
    
    Returns ID of the current reference style.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getIdForCurrentReferenceStyle(completionHandler: ((Result<String, MTError>) -> Void)? = nil)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getId(for:completionHandler:)](#/s:11MapTilerSDK7MTStyleC5getId3for17completionHandleryAA19MTMapReferenceStyleO_ys6ResultOySSAA7MTErrorOGcSgtF)`
    
    Returns ID for the provided reference style.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getId(
        for referenceStyle: MTMapReferenceStyle,
        completionHandler: ((Result<String, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>referenceStyle</em></code></td><td><div><p>Reference style for which to get id.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getIdForCurrentStyleVariant(completionHandler:)](#/s:11MapTilerSDK7MTStyleC27getIdForCurrentStyleVariant17completionHandleryys6ResultOySSAA7MTErrorOGcSg_tF)`
    
    Returns ID of the current style variant, if it exists.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getIdForCurrentStyleVariant(completionHandler: ((Result<String, MTError>) -> Void)? = nil)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getId(for:completionHandler:)](#/s:11MapTilerSDK7MTStyleC5getId3for17completionHandleryAA17MTMapStyleVariantO_ys6ResultOySSAA7MTErrorOGcSgtF)`
    
    Returns id for the provided style variant.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getId(
        for styleVariant: MTMapStyleVariant,
        completionHandler: ((Result<String, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>styleVariant</em></code></td><td><div><p>Style variant for which to get id.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getNameForCurrentReferenceStyle(completionHandler:)](#/s:11MapTilerSDK7MTStyleC31getNameForCurrentReferenceStyle17completionHandleryys6ResultOySSAA7MTErrorOGcSg_tF)`
    
    Returns name of the current reference style.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getNameForCurrentReferenceStyle(completionHandler: ((Result<String, MTError>) -> Void)? = nil)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getName(for:completionHandler:)](#/s:11MapTilerSDK7MTStyleC7getName3for17completionHandleryAA19MTMapReferenceStyleO_ys6ResultOySSAA7MTErrorOGcSgtF)`
    
    Returns name of the provided reference style.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getName(
        for referenceStyle: MTMapReferenceStyle,
        completionHandler: ((Result<String, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>referenceStyle</em></code></td><td><div><p>Reference style for which to get name.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getNameForCurrentStyleVariant(completionHandler:)](#/s:11MapTilerSDK7MTStyleC29getNameForCurrentStyleVariant17completionHandleryys6ResultOySSAA7MTErrorOGcSg_tF)`
    
    Returns name of the current style variant, if it exists.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getNameForCurrentStyleVariant(completionHandler: ((Result<String, MTError>) -> Void)? = nil)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getName(for:completionHandler:)](#/s:11MapTilerSDK7MTStyleC7getName3for17completionHandleryAA17MTMapStyleVariantO_ys6ResultOySSAA7MTErrorOGcSgtF)`
    
    Returns name for the provided style variant.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getName(
        for styleVariant: MTMapStyleVariant,
        completionHandler: ((Result<String, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>styleVariant</em></code></td><td><div><p>Style variant for which to get name.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    

[](#/Utilities)

### Utilities

-   `[forceReloadStyle(completionHandler:)](#/s:11MapTilerSDK7MTStyleC16forceReloadStyle17completionHandleryys6ResultOyytAA7MTErrorOGcSg_tF)`
    
    Forces a style reload using the current reference style and variant. Also reapplies any configured `space` from map options to keep background consistent.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func forceReloadStyle(completionHandler: ((Result<Void, MTError>) -> Void)? = nil)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>completionHandler</em></code></td><td><div><p>Optional completion handler (deprecated; prefer async overload).</p></div></td></tr></tbody></table>
    
-   `[forceReloadStyle()](#/s:11MapTilerSDK7MTStyleC16forceReloadStyleyyYaF)` Asynchronous
    
    Forces a style reload using the current reference style and variant. Also reapplies any configured `space` from map options to keep background consistent.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func forceReloadStyle() async
    ```
    

[](#/Circle%20helpers)

### Circle helpers

-   `[setCircleRadiusStep(layerId:key:default:stops:completionHandler:)](#/s:11MapTilerSDK7MTStyleC19setCircleRadiusStep7layerId3key7default5stops17completionHandlerySS_AA12MTFeatureKeyOSdSaySd_SdtGys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets circle radius as a step expression on a feature key.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    func setCircleRadiusStep(
        layerId: String,
        key: MTFeatureKey,
        default defaultRadius: Double,
        stops: [(Double, Double)],
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
-   `[setCircleColorStep(layerId:key:default:stops:completionHandler:)](#/s:11MapTilerSDK7MTStyleC18setCircleColorStep7layerId3key7default5stops17completionHandlerySS_AA12MTFeatureKeyOSo7UIColorCSaySd_AMtGys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets circle color as a step expression on a feature key.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    func setCircleColorStep(
        layerId: String,
        key: MTFeatureKey,
        default defaultColor: UIColor,
        stops: [(Double, UIColor)],
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    

[](#/Symbol%20helpers)

### Symbol helpers

-   `[setTextFieldToken(layerId:token:completionHandler:)](#/s:11MapTilerSDK7MTStyleC17setTextFieldToken7layerId5token17completionHandlerySS_AA06MTTextH0Oys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets text field using a common token.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    func setTextFieldToken(
        layerId: String,
        token: MTTextToken,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
-   `[setTextSize(layerId:size:completionHandler:)](#/s:11MapTilerSDK7MTStyleC11setTextSize7layerId4size17completionHandlerySS_Sdys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets text size.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    func setTextSize(
        layerId: String,
        size: Double,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
-   `[setTextAllowOverlap(layerId:_:completionHandler:)](#/s:11MapTilerSDK7MTStyleC19setTextAllowOverlap7layerId_17completionHandlerySS_Sbys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets text allow overlap.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    func setTextAllowOverlap(
        layerId: String,
        _ allow: Bool,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
-   `[setTextColor(layerId:color:completionHandler:)](#/s:11MapTilerSDK7MTStyleC12setTextColor7layerId5color17completionHandlerySS_So7UIColorCys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets text color.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    func setTextColor(
        layerId: String,
        color: UIColor,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
-   `[setTextAnchor(layerId:anchor:completionHandler:)](#/s:11MapTilerSDK7MTStyleC13setTextAnchor7layerId6anchor17completionHandlerySS_AA06MTTextG0Oys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets text anchor.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    func setTextAnchor(
        layerId: String,
        anchor: MTTextAnchor,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
-   `[setTextFont(layerId:fonts:completionHandler:)](#/s:11MapTilerSDK7MTStyleC11setTextFont7layerId5fonts17completionHandlerySS_SaySSGys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets text font. Provide an ordered list of font families.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    func setTextFont(
        layerId: String,
        fonts: [String],
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    

[](#/Async%20versions)

### Async versions

-   `[setCircleRadiusStep(layerId:key:default:stops:)](#/s:11MapTilerSDK7MTStyleC19setCircleRadiusStep7layerId3key7default5stopsySS_AA12MTFeatureKeyOSdSaySd_SdtGtYaF)` Asynchronous
    
    Sets circle radius as a step expression on a feature key.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setCircleRadiusStep(
        layerId: String,
        key: MTFeatureKey,
        default defaultRadius: Double,
        stops: [(Double, Double)]
    ) async
    ```
    
-   `[setCircleColorStep(layerId:key:default:stops:)](#/s:11MapTilerSDK7MTStyleC18setCircleColorStep7layerId3key7default5stopsySS_AA12MTFeatureKeyOSo7UIColorCSaySd_ALtGtYaF)` Asynchronous
    
    Sets circle color as a step expression on a feature key.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setCircleColorStep(
        layerId: String,
        key: MTFeatureKey,
        default defaultColor: UIColor,
        stops: [(Double, UIColor)]
    ) async
    ```
    
-   `[setTextFieldToken(layerId:token:)](#/s:11MapTilerSDK7MTStyleC17setTextFieldToken7layerId5tokenySS_AA06MTTextH0OtYaF)` Asynchronous
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setTextFieldToken(layerId: String, token: MTTextToken) async
    ```
    
-   `[setTextSize(layerId:size:)](#/s:11MapTilerSDK7MTStyleC11setTextSize7layerId4sizeySS_SdtYaF)` Asynchronous
    
    Sets text size.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setTextSize(layerId: String, size: Double) async
    ```
    
-   `[setTextAllowOverlap(layerId:_:)](#/s:11MapTilerSDK7MTStyleC19setTextAllowOverlap7layerId_ySS_SbtYaF)` Asynchronous
    
    Sets text allow overlap.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setTextAllowOverlap(layerId: String, _ allow: Bool) async
    ```
    
-   `[setTextColor(layerId:color:)](#/s:11MapTilerSDK7MTStyleC12setTextColor7layerId5colorySS_So7UIColorCtYaF)` Asynchronous
    
    Sets text color.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setTextColor(layerId: String, color: UIColor) async
    ```
    
-   `[setTextAnchor(layerId:anchor:)](#/s:11MapTilerSDK7MTStyleC13setTextAnchor7layerId6anchorySS_AA06MTTextG0OtYaF)` Asynchronous
    
    Sets text anchor.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setTextAnchor(layerId: String, anchor: MTTextAnchor) async
    ```
    
-   `[setTextFont(layerId:fonts:)](#/s:11MapTilerSDK7MTStyleC11setTextFont7layerId5fontsySS_SaySSGtYaF)` Asynchronous
    
    Sets text font. Provide an ordered list of font families.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    func setTextFont(layerId: String, fonts: [String]) async
    ```
    
-   `[addSource(_:completionHandler:)](#/s:11MapTilerSDK7MTStyleC9addSource_17completionHandleryAA8MTSource_p_ys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Adds a source to the map.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func addSource(_ source: MTSource, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>source</em></code></td><td><div><p>Source to be added.</p></div></td></tr></tbody></table>
    
-   `[removeSource(_:completionHandler:)](#/s:11MapTilerSDK7MTStyleC12removeSource_17completionHandleryAA8MTSource_p_ys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Removes a source from the map.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func removeSource(_ source: MTSource, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>source</em></code></td><td><div><p>Source to be removed.</p></div></td></tr></tbody></table>
    
-   `[sourceExists(_:)](#/s:11MapTilerSDK7MTStyleC12sourceExistsySbAA8MTSource_pF)`
    
    Returns a boolean indicating whether a source is already added to the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func sourceExists(_ source: MTSource) -> Bool
    ```
    
-   `[addLayer(_:completionHandler:)](#/s:11MapTilerSDK7MTStyleC8addLayer_17completionHandleryAA7MTLayer_p_ys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Adds a layer to the map.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func addLayer(_ layer: MTLayer, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layer</em></code></td><td><div><p>Layer to be added.</p></div></td></tr></tbody></table>
    
-   `[addLayers(_:completionHandler:)](#/s:11MapTilerSDK7MTStyleC9addLayers_17completionHandlerySayAA7MTLayer_pG_ys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Adds multiple layers to the map.
    
    Note
    
    All parent sources must be loaded prior to calling this method.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func addLayers(_ layers: [MTLayer], completionHandler: ((Result<Void, MTError>) -> Void)? = nil)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layers</em></code></td><td><div><p>Layers to be added.</p></div></td></tr></tbody></table>
    
-   `[removeLayer(_:completionHandler:)](#/s:11MapTilerSDK7MTStyleC11removeLayer_17completionHandleryAA7MTLayer_p_ys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Removes a layer from the map.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func removeLayer(_ layer: MTLayer, completionHandler: ((Result<Void, MTError>) -> Void)? = nil)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layer</em></code></td><td><div><p>Layer to be removed.</p></div></td></tr></tbody></table>
    
-   `[removeLayers(_:completionHandler:)](#/s:11MapTilerSDK7MTStyleC12removeLayers_17completionHandlerySayAA7MTLayer_pG_ys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Remove multiple layers from the map.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func removeLayers(_ layers: [MTLayer], completionHandler: ((Result<Void, MTError>) -> Void)? = nil)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layers</em></code></td><td><div><p>Layers to be removed.</p></div></td></tr></tbody></table>
    
-   `[moveLayer(id:beforeId:completionHandler:)](#/s:11MapTilerSDK7MTStyleC9moveLayer2id8beforeId17completionHandlerySS_SSSgys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Moves a layer to a different z-position.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func moveLayer(
        id: String,
        beforeId: String? = nil,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>id</em></code></td><td><div><p>The ID of the layer to move.</p></div></td></tr><tr><td><code><em>beforeId</em></code></td><td><div><p>The ID of an existing layer to insert the new layer before, resulting in the new layer appearing visually beneath the <code>beforeId</code> layer. If <code>nil</code>, the layer is appended to the end of the layers array and appears visually above all other layers.</p></div></td></tr></tbody></table>
    
-   `[layerExists(_:)](#/s:11MapTilerSDK7MTStyleC11layerExistsySbAA7MTLayer_pF)`
    
    Returns a boolean indicating whether a layer is already added to the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func layerExists(_ layer: MTLayer) -> Bool
    ```
    
-   `[setStyle(_:styleVariant:)](#/s:11MapTilerSDK7MTStyleC8setStyle_12styleVariantyAA014MTMapReferenceF0O_AA0ifH0OSgtYaF)` Asynchronous
    
    Updates the map’s style object with a new value.
    
    Setting the style resets custom sources and layers, so make sure to wait for style to load (`[styleDidUpdate](https://docs.maptiler.com/mobile-sdk/ios/api/Enums/MTEvent/#/s:11MapTilerSDK7MTEventO14styleDidUpdateyA2CmF)`) before adding them.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setStyle(_ referenceStyle: MTMapReferenceStyle, styleVariant: MTMapStyleVariant?) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>referenceStyle</em></code></td><td><div><p>Desired reference map style.</p></div></td></tr><tr><td><code><em>styleVariant</em></code></td><td><div><p>Optional variant of the reference style.</p></div></td></tr></tbody></table>
    
-   `[getIdForCurrentReferenceStyle()](#/s:11MapTilerSDK7MTStyleC29getIdForCurrentReferenceStyleSSyYaF)` Asynchronous
    
    Returns ID of the current reference style.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getIdForCurrentReferenceStyle() async -> String
    ```
    
-   `[getId(for:)](#/s:11MapTilerSDK7MTStyleC5getId3forSSAA19MTMapReferenceStyleO_tYaF)` Asynchronous
    
    Returns ID for the provided reference style.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getId(for referenceStyle: MTMapReferenceStyle) async -> String
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>referenceStyle</em></code></td><td><div><p>Reference style for which to get id.</p></div></td></tr></tbody></table>
    
-   `[getIdForCurrentStyleVariant()](#/s:11MapTilerSDK7MTStyleC27getIdForCurrentStyleVariantSSSgyYaF)` Asynchronous
    
    Returns ID of the current style variant, if it exists.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getIdForCurrentStyleVariant() async -> String?
    ```
    
-   `[getId(for:)](#/s:11MapTilerSDK7MTStyleC5getId3forSSAA17MTMapStyleVariantO_tYaF)` Asynchronous
    
    Returns id for the provided style variant.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getId(for styleVariant: MTMapStyleVariant) async -> String
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>styleVariant</em></code></td><td><div><p>Style variant for which to get id.</p></div></td></tr></tbody></table>
    
-   `[getNameForCurrentReferenceStyle()](#/s:11MapTilerSDK7MTStyleC31getNameForCurrentReferenceStyleSSyYaF)` Asynchronous
    
    Returns name of the current reference style.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getNameForCurrentReferenceStyle() async -> String
    ```
    
-   `[getName(for:)](#/s:11MapTilerSDK7MTStyleC7getName3forSSAA19MTMapReferenceStyleO_tYaF)` Asynchronous
    
    Returns name of the provided reference style.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getName(for referenceStyle: MTMapReferenceStyle) async -> String
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>referenceStyle</em></code></td><td><div><p>Reference style for which to get name.</p></div></td></tr></tbody></table>
    
-   `[getNameForCurrentStyleVariant()](#/s:11MapTilerSDK7MTStyleC29getNameForCurrentStyleVariantSSSgyYaF)` Asynchronous
    
    Returns name of the current style variant, if it exists.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getNameForCurrentStyleVariant() async -> String?
    ```
    
-   `[getName(for:)](#/s:11MapTilerSDK7MTStyleC7getName3forSSAA17MTMapStyleVariantO_tYaF)` Asynchronous
    
    Returns name for the provided style variant.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getName(for styleVariant: MTMapStyleVariant) async -> String
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>styleVariant</em></code></td><td><div><p>Style variant for which to get name.</p></div></td></tr></tbody></table>
    
-   `[addSource(_:)](#/s:11MapTilerSDK7MTStyleC9addSourceyyAA8MTSource_pYaKF)` Asynchronous
    
    Adds a source to the map.
    
    Throws
    
    A `[MTStyleError.sourceAlreadyExists](https://docs.maptiler.com/mobile-sdk/ios/api/Enums/MTStyleError/#/s:11MapTilerSDK12MTStyleErrorO19sourceAlreadyExistsyA2CmF)` if source with the same id is already added to the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func addSource(_ source: MTSource) async throws
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>source</em></code></td><td><div><p>Source to be added.</p></div></td></tr></tbody></table>
    
-   `[removeSource(_:)](#/s:11MapTilerSDK7MTStyleC12removeSourceyyAA8MTSource_pYaKF)` Asynchronous
    
    Removes a source from the map.
    
    Throws
    
    A `[MTStyleError.sourceNotFound](https://docs.maptiler.com/mobile-sdk/ios/api/Enums/MTStyleError/#/s:11MapTilerSDK12MTStyleErrorO14sourceNotFoundyA2CmF)` if source does not exist on the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func removeSource(_ source: MTSource) async throws
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>source</em></code></td><td><div><p>Source to be removed.</p></div></td></tr></tbody></table>
    
-   `[addLayer(_:)](#/s:11MapTilerSDK7MTStyleC8addLayeryyAA7MTLayer_pYaKF)` Asynchronous
    
    Adds a layer to the map.
    
    Throws
    
    A `[MTStyleError.layerAlreadyExists](https://docs.maptiler.com/mobile-sdk/ios/api/Enums/MTStyleError/#/s:11MapTilerSDK12MTStyleErrorO18layerAlreadyExistsyA2CmF)` if layer with the same id is already added to the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func addLayer(_ layer: MTLayer) async throws
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layer</em></code></td><td><div><p>Layer to be added.</p></div></td></tr></tbody></table>
    
-   `[addLayers(_:)](#/s:11MapTilerSDK7MTStyleC9addLayersyySayAA7MTLayer_pGYaKF)` Asynchronous
    
    Adds multiple layers to the map.
    
    Note
    
    All parent sources must be loaded prior to calling this method.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func addLayers(_ layers: [MTLayer]) async throws
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layers</em></code></td><td><div><p>Layers to be added.</p></div></td></tr></tbody></table>
    
-   `[removeLayer(_:)](#/s:11MapTilerSDK7MTStyleC11removeLayeryyAA7MTLayer_pYaKF)` Asynchronous
    
    Removes a layer from the map.
    
    Throws
    
    A `[MTStyleError.layerNotFound](https://docs.maptiler.com/mobile-sdk/ios/api/Enums/MTStyleError/#/s:11MapTilerSDK12MTStyleErrorO13layerNotFoundyA2CmF)` if layer does not exist on the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func removeLayer(_ layer: MTLayer) async throws
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layer</em></code></td><td><div><p>Layer to be removed.</p></div></td></tr></tbody></table>
    
-   `[removeLayers(_:)](#/s:11MapTilerSDK7MTStyleC12removeLayersyySayAA7MTLayer_pGYaKF)` Asynchronous
    
    Removes multiple layers from the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func removeLayers(_ layers: [MTLayer]) async throws
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layers</em></code></td><td><div><p>Layers to be removed.</p></div></td></tr></tbody></table>
    
-   `[moveLayer(id:beforeId:)](#/s:11MapTilerSDK7MTStyleC9moveLayer2id8beforeIdySS_SSSgtYaKF)` Asynchronous
    
    Moves a layer to a different z-position.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func moveLayer(id: String, beforeId: String? = nil) async throws
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>id</em></code></td><td><div><p>The ID of the layer to move.</p></div></td></tr><tr><td><code><em>beforeId</em></code></td><td><div><p>The ID of an existing layer to insert the new layer before, resulting in the new layer appearing visually beneath the <code>beforeId</code> layer. If <code>nil</code>, the layer is appended to the end of the layers array and appears visually above all other layers.</p></div></td></tr></tbody></table>
    

[](#/Style%20property%20setters)

### Style property setters

-   `[setLayerZoomRange(layerId:minzoom:maxzoom:completionHandler:)](#/s:11MapTilerSDK7MTStyleC17setLayerZoomRange7layerId7minzoom7maxzoom17completionHandlerySS_S2dys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets min/max zoom levels at which a layer is rendered.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setLayerZoomRange(
        layerId: String,
        minzoom: Double,
        maxzoom: Double,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layerId</em></code></td><td><div><p>Target layer identifier.</p></div></td></tr><tr><td><code><em>minzoom</em></code></td><td><div><p>The minimum zoom level.</p></div></td></tr><tr><td><code><em>maxzoom</em></code></td><td><div><p>The maximum zoom level.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[setFilter(layerId:filter:completionHandler:)](#/s:11MapTilerSDK7MTStyleC9setFilter7layerId6filter17completionHandlerySS_AA15MTPropertyValueOys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets a filter expression on a layer.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setFilter(
        layerId: String,
        filter: MTPropertyValue,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layerId</em></code></td><td><div><p>Target layer identifier.</p></div></td></tr><tr><td><code><em>filter</em></code></td><td><div><p>Expression value</p></div></td></tr></tbody></table>
    
-   `[setLayoutProperty(layerId:name:value:completionHandler:)](#/s:11MapTilerSDK7MTStyleC17setLayoutProperty7layerId4name5value17completionHandlerySS_SSAA15MTPropertyValueOys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets a layout property on a layer.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setLayoutProperty(
        layerId: String,
        name: String,
        value: MTPropertyValue,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layerId</em></code></td><td><div><p>Target layer identifier.</p></div></td></tr><tr><td><code><em>name</em></code></td><td><div><p>Layout property name</p></div></td></tr><tr><td><code><em>value</em></code></td><td><div><p>Property value or expression.</p></div></td></tr></tbody></table>
    
-   `[setPaintProperty(layerId:name:value:completionHandler:)](#/s:11MapTilerSDK7MTStyleC16setPaintProperty7layerId4name5value17completionHandlerySS_SSAA15MTPropertyValueOys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets a paint property on a layer.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setPaintProperty(
        layerId: String,
        name: String,
        value: MTPropertyValue,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layerId</em></code></td><td><div><p>Target layer identifier.</p></div></td></tr><tr><td><code><em>name</em></code></td><td><div><p>Paint property name</p></div></td></tr><tr><td><code><em>value</em></code></td><td><div><p>Property value or expression.</p></div></td></tr></tbody></table>
    

[](#/Typed%20property%20setters%20%28overloads%29)

### Typed property setters (overloads)

-   `[setLayoutProperty(layerId:property:value:completionHandler:)](#/s:11MapTilerSDK7MTStyleC17setLayoutProperty7layerId8property5value17completionHandlerySS_AA08MTSymbolfG0OAA15MTPropertyValueOys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets a symbol layout property using a typed key.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setLayoutProperty(
        layerId: String,
        property: MTSymbolLayoutProperty,
        value: MTPropertyValue,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layerId</em></code></td><td><div><p>Target layer identifier.</p></div></td></tr><tr><td><code><em>property</em></code></td><td><div><p>Typed layout property key for symbol layers.</p></div></td></tr><tr><td><code><em>value</em></code></td><td><div><p>Property value or expression.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[setPaintProperty(layerId:property:value:completionHandler:)](#/s:11MapTilerSDK7MTStyleC16setPaintProperty7layerId8property5value17completionHandlerySS_AA08MTCirclefG0OAA15MTPropertyValueOys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets a circle paint property using a typed key.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setPaintProperty(
        layerId: String,
        property: MTCirclePaintProperty,
        value: MTPropertyValue,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layerId</em></code></td><td><div><p>Target layer identifier.</p></div></td></tr><tr><td><code><em>property</em></code></td><td><div><p>Typed paint property key for circle layers.</p></div></td></tr><tr><td><code><em>value</em></code></td><td><div><p>Property value or expression.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[setPaintProperty(layerId:property:value:completionHandler:)](#/s:11MapTilerSDK7MTStyleC16setPaintProperty7layerId8property5value17completionHandlerySS_AA08MTSymbolfG0OAA15MTPropertyValueOys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets a symbol paint property using a typed key.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setPaintProperty(
        layerId: String,
        property: MTSymbolPaintProperty,
        value: MTPropertyValue,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layerId</em></code></td><td><div><p>Target layer identifier.</p></div></td></tr><tr><td><code><em>property</em></code></td><td><div><p>Typed paint property key for symbol layers.</p></div></td></tr><tr><td><code><em>value</em></code></td><td><div><p>Property value or expression.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    

[](#/Style%20property%20setters2)

### Style property setters

-   `[setLayerZoomRange(layerId:minzoom:maxzoom:)](#/s:11MapTilerSDK7MTStyleC17setLayerZoomRange7layerId7minzoom7maxzoomySS_S2dtYaF)` Asynchronous
    
    Sets min/max zoom levels at which a layer is rendered.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setLayerZoomRange(layerId: String, minzoom: Double, maxzoom: Double) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layerId</em></code></td><td><div><p>Target layer identifier.</p></div></td></tr><tr><td><code><em>minzoom</em></code></td><td><div><p>The minimum zoom level.</p></div></td></tr><tr><td><code><em>maxzoom</em></code></td><td><div><p>The maximum zoom level.</p></div></td></tr></tbody></table>
    
-   `[setFilter(layerId:filter:)](#/s:11MapTilerSDK7MTStyleC9setFilter7layerId6filterySS_AA15MTPropertyValueOtYaF)` Asynchronous
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setFilter(layerId: String, filter: MTPropertyValue) async
    ```
    
-   `[setLayoutProperty(layerId:name:value:)](#/s:11MapTilerSDK7MTStyleC17setLayoutProperty7layerId4name5valueySS_SSAA15MTPropertyValueOtYaF)` Asynchronous
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setLayoutProperty(layerId: String, name: String, value: MTPropertyValue) async
    ```
    
-   `[setPaintProperty(layerId:name:value:)](#/s:11MapTilerSDK7MTStyleC16setPaintProperty7layerId4name5valueySS_SSAA15MTPropertyValueOtYaF)` Asynchronous
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setPaintProperty(layerId: String, name: String, value: MTPropertyValue) async
    ```
    

[](#/Typed%20property%20setters%20%28async%29)

### Typed property setters (async)

-   `[setLayoutProperty(layerId:property:value:)](#/s:11MapTilerSDK7MTStyleC17setLayoutProperty7layerId8property5valueySS_AA08MTSymbolfG0OAA15MTPropertyValueOtYaF)` Asynchronous
    
    Sets a symbol layout property using a typed key (async).
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setLayoutProperty(layerId: String, property: MTSymbolLayoutProperty, value: MTPropertyValue) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layerId</em></code></td><td><div><p>Target layer identifier.</p></div></td></tr><tr><td><code><em>property</em></code></td><td><div><p>Typed layout property key for symbol layers.</p></div></td></tr><tr><td><code><em>value</em></code></td><td><div><p>Property value or expression.</p></div></td></tr></tbody></table>
    
-   `[setPaintProperty(layerId:property:value:)](#/s:11MapTilerSDK7MTStyleC16setPaintProperty7layerId8property5valueySS_AA08MTCirclefG0OAA15MTPropertyValueOtYaF)` Asynchronous
    
    Sets a circle paint property using a typed key (async).
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setPaintProperty(layerId: String, property: MTCirclePaintProperty, value: MTPropertyValue) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layerId</em></code></td><td><div><p>Target layer identifier.</p></div></td></tr><tr><td><code><em>property</em></code></td><td><div><p>Typed paint property key for circle layers.</p></div></td></tr><tr><td><code><em>value</em></code></td><td><div><p>Property value or expression.</p></div></td></tr></tbody></table>
    
-   `[setPaintProperty(layerId:property:value:)](#/s:11MapTilerSDK7MTStyleC16setPaintProperty7layerId8property5valueySS_AA08MTSymbolfG0OAA15MTPropertyValueOtYaF)` Asynchronous
    
    Sets a symbol paint property using a typed key (async).
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setPaintProperty(layerId: String, property: MTSymbolPaintProperty, value: MTPropertyValue) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>layerId</em></code></td><td><div><p>Target layer identifier.</p></div></td></tr><tr><td><code><em>property</em></code></td><td><div><p>Typed paint property key for symbol layers.</p></div></td></tr><tr><td><code><em>value</em></code></td><td><div><p>Property value or expression.</p></div></td></tr></tbody></table>
