Lazy Evaluation in Objective-C
Applying the runtime techniques we described above yields a function,
TESSValueize
, which takes a block and swizzles it to be a member of a subclass (dynamically created if it does not already exist), copying in methods from theTESSValue
class which conforms to theTESSValue
protocol (remember that protocols and classes have different namespaces).