Inherits from DTCoreTextLayoutFrame : NSObject
Declared in DTMutableCoreTextLayoutFrame.h

Overview

Mutable subclass of DTCoreTextLayoutFrame to allow editing

Properties

shouldRebuildLines

Specifies if the next time the frame of the receiver is modified it should also do a layout pass.

@property (nonatomic, assign) BOOL shouldRebuildLines

Discussion

Defaults to YES

Declared In

DTMutableCoreTextLayoutFrame.h

Instance Methods

initWithFrame:attributedString:

Default initializer.

- (id)initWithFrame:(CGRect)frame attributedString:(NSAttributedString *)attributedString

Parameters

frame

The frame that is available for text

attributedString

The attributed string to fill the receiver with

Return Value

An initialized mutable layout frame

Declared In

DTMutableCoreTextLayoutFrame.h

relayoutText

Re-layouts the text contents of the receiver and adjusts the frame to match the contents

- (void)relayoutText

Declared In

DTMutableCoreTextLayoutFrame.h

relayoutTextInRange:

Relayouts the text in the given string range

- (void)relayoutTextInRange:(NSRange)range

Parameters

range

The string range to redo layout for

Discussion

Note: This method might be defunct as all incremental layouting uses replaceTextRange:withText:directRect: at present.

Declared In

DTMutableCoreTextLayoutFrame.h

replaceTextInRange:withText:dirtyRect:

Replaces the attributed text in the given range with new text and optionally returns the dirty rectangle this change has caused.

- (void)replaceTextInRange:(NSRange)range withText:(NSAttributedString *)text dirtyRect:(CGRect *)dirtyRect

Parameters

range

The string range to replace

text

The text to replace the range with

dirtyRect

Output param to receive the dirtyRect or NULL if this is not required

Declared In

DTMutableCoreTextLayoutFrame.h

setAttributedString:

Replaces the text contents of the receiver

- (void)setAttributedString:(NSAttributedString *)attributedString

Parameters

attributedString

The new attributed string

Declared In

DTMutableCoreTextLayoutFrame.h

setFrame:

Modifies the text frame of the receiver.

- (void)setFrame:(CGRect)frame

Parameters

frame

The new frame

Discussion

Set shouldRebuildLines to NO to avoid relayouting text on a frame change

Declared In

DTMutableCoreTextLayoutFrame.h