---
title: "byDifference(from:)"
framework: spritekit
role: symbol
role_heading: Instance Method
path: "spritekit/skregion/bydifference(from:)"
---

# byDifference(from:)

Returns a new region created by subtracting the contents of another region from this region.

## Declaration

```swift
func byDifference(from region: SKRegion) -> Self
```

## Parameters

- `region`: The region to subtract.

## Return Value

Return Value A new region whose contents include all points in the current region that are not also included in the second region.

## See Also

### Creating and Initializing Region Objects

- [infinite()](spritekit/skregion/infinite().md)
- [init(size:)](spritekit/skregion/init(size:).md)
- [init(radius:)](spritekit/skregion/init(radius:).md)
- [init(path:)](spritekit/skregion/init(path:).md)
- [inverse()](spritekit/skregion/inverse().md)
- [byIntersection(with:)](spritekit/skregion/byintersection(with:).md)
- [byUnion(with:)](spritekit/skregion/byunion(with:).md)
