---
title: "setTileGroup(_:andTileDefinition:forColumn:row:)"
framework: spritekit
role: symbol
role_heading: Instance Method
path: "spritekit/sktilemapnode/settilegroup(_:andtiledefinition:forcolumn:row:)"
---

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

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

## Declaration

```swift
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

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

## See Also

### Defining a Tile Map’s Contents

- [enableAutomapping](spritekit/sktilemapnode/enableautomapping.md)
- [fill(with:)](spritekit/sktilemapnode/fill(with:).md)
- [setTileGroup(_:forColumn:row:)](spritekit/sktilemapnode/settilegroup(_:forcolumn:row:).md)
