Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More GFM :-)

  • Loading branch information...
commit f009128ca0fbfd7537b72e2b79c3feb6785d33c8 1 parent 0132163
@groue authored
Showing with 12 additions and 6 deletions.
  1. +12 −6 guides/delegate.md
View
18 guides/delegate.md
@@ -15,13 +15,17 @@ Observe the template rendering
The protocol allows you to observe the rendering of a whole template:
-- `- (void)templateWillRender:(GRMustacheTemplate *)template;`
-- `- (void)templateDidRender:(GRMustacheTemplate *)template;`
+```objc
+- (void)templateWillRender:(GRMustacheTemplate *)template;
+- (void)templateDidRender:(GRMustacheTemplate *)template;
+```
Two other methods allow to observe the rendering of Mustache tags:
-- `- (void)template:(GRMustacheTemplate *)template willRenderReturnValueOfInvocation:(GRMustacheInvocation *)invocation;`
-- `- (void)template:(GRMustacheTemplate *)template didRenderReturnValueOfInvocation:(GRMustacheInvocation *)invocation;`
+```objc
+- (void)template:(GRMustacheTemplate *)template willRenderReturnValueOfInvocation:(GRMustacheInvocation *)invocation;
+- (void)template:(GRMustacheTemplate *)template didRenderReturnValueOfInvocation:(GRMustacheInvocation *)invocation;
+```
Maybe verbose. But quite on target.
@@ -29,8 +33,10 @@ Those methods are called before and after GRMustache renders the result of an *i
You can read the following properties of the *invocation* argument:
-- `@property (nonatomic, readonly) NSString *key;`
-- `@property (nonatomic, retain) id returnValue;`
+```objc
+@property (nonatomic, readonly) NSString *key;
+@property (nonatomic, retain) id returnValue;
+```
`returnValue` will give you the return value (`@"Eric Paul"`, in our example). `key` contains the key that did provide this value (`@"name"`, in our example).
Please sign in to comment.
Something went wrong with that request. Please try again.