Initializes a graph that describes an integer grid with the specified dimensions, using the specified node class.
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
The lowest x- and y-coordinates to appear in the grid.
The number of possible x-coordinates in the grid.
The number of possible y-coordinates in the grid.
trueto connect nodes in the grid to their diagonal neighbors;
falseto connect nodes only to their horizontal and vertical neighbors.
GKGridsubclass to use for nodes in the graph.
A new grid graph.
node parameter to create a graph using a custom subclass of
GKGrid. For example, your custom node class might override the
cost(to:) method so that some nodes are more costly than others to travel through. Pathfinding in such a graph would favor indirect routes when a direct route has a higher cost.
All connections created through this method are bidirectional.