<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKTileGroup",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKTileGroup"
  },
  "title" : "SKTileGroup"
}
-->

# SKTileGroup

A set of tiles that collectively define one type of terrain.

```
class SKTileGroup
```

## Overview

An `SKTileGroup` object contains either the definition of a single tile or an array of [`SKTileGroupRule`](/documentation/SpriteKit/SKTileGroupRule) objects that define adjacency rules.

You supply a tile group with either:

- The definition of a single tile that can be used to populate a tile map node with a single texture.
- An array of one or more tile group rules that allow for the automatic placement of textures dependent on their adjacency and the placement weights of their definitions. For example, a tile group may contain nine tile group rules containing the definitions of the central tile and eight edge tiles that, when placed adjacently, appear as a single object.

The preferred method to create tile groups is to use the editor tools in Xcode. However, to work with SpriteKit’s tile support programmatically, see the following articles.

## Topics

### Creating Tile Groups

[Creating Tile Groups Programmatically](/documentation/SpriteKit/creating-tile-groups-programmatically)

Paint tiles on a map by putting tile definitions in a group that you create in code.

[`init(tileDefinition:)`](/documentation/SpriteKit/SKTileGroup/init(tileDefinition:))

Creates and initializes a simple tile group with a single tile definition.

[`tileGroupWithTileDefinition:`](/documentation/SpriteKit/SKTileGroup/tileGroupWithTileDefinition:)

[`init(rules:)`](/documentation/SpriteKit/SKTileGroup/init(rules:))

Creates and initializes a tile group with the specified tile group rules.

[`tileGroupWithRules:`](/documentation/SpriteKit/SKTileGroup/tileGroupWithRules:)

### Accessing or Setting a Tile Group’s Properties

[`name`](/documentation/SpriteKit/SKTileGroup/name)

The receiver’s name.

[`rules`](/documentation/SpriteKit/SKTileGroup/rules)

An array of [`SKTileGroupRule`](/documentation/SpriteKit/SKTileGroupRule) objects that the tile group uses to determine tile placement.

### Creating an Empty Tile Group

Create an empty tile group to erase tiles at a given location on a map.

[`empty()`](/documentation/SpriteKit/SKTileGroup/empty())

Creates an empty tile that erases the existing tile at that location on a tile map.



---

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)