---
title: "MTSpace | Mobile sdk | Mobile sdk ios | Ios"
description: "Configuration for the “space” background."
---

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

# MTSpace

```
public struct MTSpace : Sendable, Codable
```

Configuration for the “space” background.

-   `[color](#/s:11MapTilerSDK7MTSpaceV5colorAA7MTColorVSgvp)`
    
    Optional color to apply to the background and/or stars depending on preset.
    
    #### Declaration
    
    Swift
    
    ```
    public var color: MTColor?
    ```
    
-   `[preset](#/s:11MapTilerSDK7MTSpaceV6presetAA0D6PresetOSgvp)`
    
    Optional cubemap preset.
    
    #### Declaration
    
    Swift
    
    ```
    public var preset: MTSpacePreset?
    ```
    
-   `[faces](#/s:11MapTilerSDK7MTSpaceV5facesAA0D5FacesVSgvp)`
    
    Optional faces definition for a custom cubemap.
    
    #### Declaration
    
    Swift
    
    ```
    public var faces: MTSpaceFaces?
    ```
    
-   `[path](#/s:11MapTilerSDK7MTSpaceV4pathAA0D4PathVSgvp)`
    
    Optional path definition for a custom cubemap.
    
    #### Declaration
    
    Swift
    
    ```
    public var path: MTSpacePath?
    ```
    
-   `[init(color:preset:faces:path:)](#/s:11MapTilerSDK7MTSpaceV5color6preset5faces4pathAcA7MTColorVSg_AA0D6PresetOSgAA0D5FacesVSgAA0D4PathVSgtcfc)`
    
    Undocumented
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        color: MTColor? = nil,
        preset: MTSpacePreset? = nil,
        faces: MTSpaceFaces? = nil,
        path: MTSpacePath? = nil
    )
    ```
    
-   `[init(from:)](#/s:Se4fromxs7Decoder_p_tKcfc)`
    
    #### Declaration
    
    Swift
    
    ```
    public init(from decoder: any Decoder) throws
    ```
    
-   `[encode(to:)](#/s:SE6encode2toys7Encoder_p_tKF)`
    
    #### Declaration
    
    Swift
    
    ```
    public func encode(to encoder: Encoder) throws
    ```
