Skip to content

Instantly share code, notes, and snippets.

@github-user32
github-user32 / NSAttributedStringWrapper.h
Created October 5, 2016 03:37
NSAttributedString sub-class template
//! Sometimes it's handy to be able to temporarily swap over NSAttributedString with
//! something you can instrument. Since NSAttributedString is part of a class cluster
//! it can't easily be sub-classed.
//!
//! This class wraps it with composition and re-implements the public (at time of writing)
//! NSAttributedString API by passing through calls to the NSAttributedString component.
//!
//! Add instrumentation for your purposes and use at your own risk!
//!
@interface NSAttributedStringWrapper : NSAttributedString