ASLayoutElementPrivate Protocol Reference

Conforms to NSObject
Declared in ASLayoutElementPrivate.h

Overview

The base protocol for ASLayoutElement. Generally the methods/properties in this class do not need to be called by the end user and are only called internally. However, there may be a case where the methods are useful.

– finalLayoutElement required method

This method can be used to give the user a chance to wrap an ASLayoutElement in an ASLayoutSpec just before it is added to a parent ASLayoutSpec. For example, if you wanted an ASTextNode that was always inside of an ASInsetLayoutSpec, you could subclass ASTextNode and implement finalLayoutElement so that it wraps itself in an inset spec.

Note that any ASLayoutElement other than self that is returned MUST set isFinalLayoutElement to YES. Make sure to do this BEFORE adding a child to the ASLayoutElement.

- (id<ASLayoutElement>)finalLayoutElement

Return Value

The layoutElement that will be added to the parent layout spec. Defaults to self.

Declared In

ASLayoutElementPrivate.h

  isFinalLayoutElement required method

A flag to indicate that this ASLayoutElement was created in finalLayoutElement. This MUST be set to YES before adding a child to this layoutElement.

@property (nonatomic, assign) BOOL isFinalLayoutElement

Declared In

ASLayoutElementPrivate.h