---
title: "fill(with:)"
framework: spritekit
role: symbol
role_heading: Instance Method
path: "spritekit/sktilemapnode/fill(with:)"
---

# fill(with:)

When creating a tile map node programmatically, this function performs a fill operation with the specified tile group.

## Declaration

```swift
func fill(with tileGroup: SKTileGroup?)
```

## Parameters

- `tileGroup`: The tile group that will be used to fill the map.

## Mentioned in

Creating Tile Groups Programmatically

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

## See Also

### Defining a Tile Map’s Contents

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