Instance Method

layoutManager(_:didCompleteLayoutFor:atEnd:)

Informs the delegate that the layout manager finished laying out text in the specified text container.

Declaration

optional func layoutManager(_ layoutManager: NSLayoutManager, didCompleteLayoutFor textContainer: NSTextContainer?, atEnd layoutFinishedFlag: Bool)

Parameters

aLayoutManager

The layout manager doing the layout.

aTextContainer

The text container in which layout is complete. If nil, if there aren’t enough containers to hold all the text; the delegate can use this information as a cue to add another text container.

flag

If true, aLayoutManager is finished laying out its text—this also means that aTextContainer is the final text container used by the layout manager. Delegates can use this information to show an indicator or background or to enable or disable a button that forces immediate layout of text.

Discussion

This message is sent whenever a text container has been filled. This method can be useful for paginating.

See Also

Responding to Text Container Layout

func layoutManager(NSLayoutManager, textContainer: NSTextContainer, didChangeGeometryFrom: CGSize)

Informs the delegate that the layout manager will invalidate layout due to a change in the geometry of the specified text container.