<!--
{
  "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/SKTileMapNode/setTileGroup(_:andTileDefinition:forColumn:row:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKTileMapNode(im)setTileGroup:andTileDefinition:forColumn:row:"
  },
  "title" : "setTileGroup(_:andTileDefinition:forColumn:row:)"
}
-->

# setTileGroup(_:andTileDefinition:forColumn:row:)

Set the tile group and tile definition at the specified tile index.

```
func setTileGroup(_ tileGroup: SKTileGroup, andTileDefinition tileDefinition: SKTileDefinition, forColumn column: Int, row: Int)
```

## Parameters

`tileGroup`

The tile group to place in the map.

`tileDefinition`

The tile definition to place in the map.

`column`

The column index of the tile.

`row`

The row index of the tile.

## Discussion

This function is for use when you’re creating a tile map programmatically, versus creating it ahead of time with the scene editor.

When [`enableAutomapping`](/documentation/SpriteKit/SKTileMapNode/enableAutomapping) is set to `true`, the surrounding tiles of a painted area will be controlled by the tile group, too. When automapping is disabled, just the tile definition will be placed without modify any of the neighboring tiles.

---

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)