---
title: "appendRect(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsbezierpath/appendrect(_:)"
---

# appendRect(_:)

Appends a rectangular path to the path.

## Declaration

```swift
func appendRect(_ rect: NSRect)
```

## Parameters

- `rect`: The rectangle describing the path to create.

## Discussion

Discussion Before adding the rectangle, this method moves the current point to the origin of the rectangle, which implicitly closes the current subpath (if any). The path is constructed by starting at the origin of aRect and adding line segments in a counterclockwise direction. The final segment is added using a close() message.

## See Also

### Related Documentation

- [fill(_:)](appkit/nsbezierpath/fill(_:).md)
- [stroke(_:)](appkit/nsbezierpath/stroke(_:).md)
- [init(rect:)](appkit/nsbezierpath/init(rect:).md)

### Appending Common Shapes to a Path

- [append(_:)](appkit/nsbezierpath/append(_:).md)
- [appendPoints(_:count:)](appkit/nsbezierpath/appendpoints(_:count:).md)
- [appendOval(in:)](appkit/nsbezierpath/appendoval(in:).md)
- [appendArc(from:to:radius:)](appkit/nsbezierpath/appendarc(from:to:radius:).md)
- [appendArc(withCenter:radius:startAngle:endAngle:)](appkit/nsbezierpath/appendarc(withcenter:radius:startangle:endangle:).md)
- [appendArc(withCenter:radius:startAngle:endAngle:clockwise:)](appkit/nsbezierpath/appendarc(withcenter:radius:startangle:endangle:clockwise:).md)
- [appendRoundedRect(_:xRadius:yRadius:)](appkit/nsbezierpath/appendroundedrect(_:xradius:yradius:).md)
- [append(withCGGlyph:in:)](appkit/nsbezierpath/append(withcgglyph:in:).md)
- [append(withCGGlyphs:count:in:)](appkit/nsbezierpath/append(withcgglyphs:count:in:).md)
- [appendGlyph(_:in:)](appkit/nsbezierpath/appendglyph(_:in:).md)
- [appendGlyphs(_:count:in:)](appkit/nsbezierpath/appendglyphs(_:count:in:).md)
- [appendPackedGlyphs(_:)](appkit/nsbezierpath/appendpackedglyphs(_:).md)
