Instance Method

addObstacles:

Adds new obstacles to the graph.

Declaration

- (void)addObstacles:(NSArray<GKPolygonObstacle *> *)obstacles;

Parameters

obstacles

An array of obstacle objects to be added to the graph.

Discussion

Adding a new obstacle to the graph has the same effect as if that obstacle were present when creating the graph—that is, the GKObstacleGraph class automatically creates new nodes and edges where necessary to describe the navigable area around the complete collection of obstacles.

See Also

Working with Obstacles

obstacles

The list of obstacle objects in the graph, each of which describes a polygon-shaped impassable area.

- removeObstacles:

Removes the specified obstacle from the graph.

- removeAllObstacles

Removes all obstacles from the graph.

- nodesForObstacle:

Returns the group of nodes corresponding to an obstacle in the graph.