CKTextKitTruncating Protocol Reference

Conforms to NSObject
Declared in CKTextKitTruncating.h

– initWithContext:truncationAttributedString:avoidTailTruncationSet:constrainedSize: required method

A truncater object is initialized with the full state of the text. It is a Single Responsibility Object that is mutative. It configures the state of the TextKit components (layout manager, text container, text storage) to achieve the intended truncation, then it stores the resulting state for later fetching.

- (instancetype)initWithContext:(CKTextKitContext *)context truncationAttributedString:(NSAttributedString *)truncationAttributedString avoidTailTruncationSet:(NSCharacterSet *)avoidTailTruncationSet constrainedSize:(CGSize)constrainedSize

Discussion

The truncater may mutate the state of the text storage such that only the drawn string is actually present in the text storage itself.

The truncater should not store a strong reference to the context to prevent retain cycles.

Declared In

CKTextKitTruncating.h