---
title: "NSDivideRect(_:_:_:_:_:)"
framework: foundation
role: symbol
role_heading: Function
path: "foundation/nsdividerect(_:_:_:_:_:)"
---

# NSDivideRect(_:_:_:_:_:)

Divides a rectangle into two new rectangles.

## Declaration

```swift
func NSDivideRect(_ inRect: NSRect, _ slice: UnsafeMutablePointer<NSRect>, _ rem: UnsafeMutablePointer<NSRect>, _ amount: Double, _ edge: NSRectEdge)
```

## Discussion

Discussion Creates two rectangles—slice and rem—from inRect, by dividing inRect with a line that’s parallel to the side of inRect specified by edge. The size of slice is determined by amount, which specifies the distance from edge. slice and rem must not be NULL. For more information, see NSRectEdge.

## See Also

### Managing Rectangles

- [NSContainsRect(_:_:)](foundation/nscontainsrect(_:_:).md)
- [NSEqualRects(_:_:)](foundation/nsequalrects(_:_:).md)
- [NSIsEmptyRect(_:)](foundation/nsisemptyrect(_:).md)
- [NSHeight(_:)](foundation/nsheight(_:).md)
- [NSInsetRect(_:_:_:)](foundation/nsinsetrect(_:_:_:).md)
- [NSIntegralRect(_:)](foundation/nsintegralrect(_:).md)
- [NSIntegralRectWithOptions(_:_:)](foundation/nsintegralrectwithoptions(_:_:).md)
- [NSIntersectionRect(_:_:)](foundation/nsintersectionrect(_:_:).md)
- [NSIntersectsRect(_:_:)](foundation/nsintersectsrect(_:_:).md)
- [NSMakeRect(_:_:_:_:)](foundation/nsmakerect(_:_:_:_:).md)
- [NSMaxX(_:)](foundation/nsmaxx(_:).md)
- [NSMaxY(_:)](foundation/nsmaxy(_:).md)
- [NSMidX(_:)](foundation/nsmidx(_:).md)
- [NSMidY(_:)](foundation/nsmidy(_:).md)
- [NSMinX(_:)](foundation/nsminx(_:).md)
