---
title: "layoutManager(_:paragraphSpacingBeforeGlyphAt:withProposedLineFragmentRect:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nslayoutmanagerdelegate/layoutmanager(_:paragraphspacingbeforeglyphat:withproposedlinefragmentrect:)"
---

# layoutManager(_:paragraphSpacingBeforeGlyphAt:withProposedLineFragmentRect:)

Returns the amount of space to add at the beginning of a paragraph.

## Declaration

```swift
optional func layoutManager(_ layoutManager: NSLayoutManager, paragraphSpacingBeforeGlyphAt glyphIndex: Int, withProposedLineFragmentRect rect: CGRect) -> CGFloat
```

## Parameters

- `layoutManager`: The layout manager doing the layout.
- `glyphIndex`: The index of the glyph at the beginning of the line.
- `rect`: The proposed line fragment rectangle for the current line.

## Return Value

Return Value The paragraph spacing before the current line.

## Discussion

Discussion This message is sent while each line is laid out to enable the layout manager delegate to customize the shape of line.

## See Also

### Handling line fragments

- [layoutManager(_:shouldBreakLineByHyphenatingBeforeCharacterAt:)](uikit/nslayoutmanagerdelegate/layoutmanager(_:shouldbreaklinebyhyphenatingbeforecharacterat:).md)
- [layoutManager(_:shouldBreakLineByWordBeforeCharacterAt:)](uikit/nslayoutmanagerdelegate/layoutmanager(_:shouldbreaklinebywordbeforecharacterat:).md)
- [layoutManager(_:lineSpacingAfterGlyphAt:withProposedLineFragmentRect:)](uikit/nslayoutmanagerdelegate/layoutmanager(_:linespacingafterglyphat:withproposedlinefragmentrect:).md)
- [layoutManager(_:paragraphSpacingAfterGlyphAt:withProposedLineFragmentRect:)](uikit/nslayoutmanagerdelegate/layoutmanager(_:paragraphspacingafterglyphat:withproposedlinefragmentrect:).md)
- [layoutManager(_:boundingBoxForControlGlyphAt:for:proposedLineFragment:glyphPosition:characterIndex:)](uikit/nslayoutmanagerdelegate/layoutmanager(_:boundingboxforcontrolglyphat:for:proposedlinefragment:glyphposition:characterindex:).md)
- [layoutManager(_:shouldSetLineFragmentRect:lineFragmentUsedRect:baselineOffset:in:forGlyphRange:)](uikit/nslayoutmanagerdelegate/layoutmanager(_:shouldsetlinefragmentrect:linefragmentusedrect:baselineoffset:in:forglyphrange:).md)
