Conforms to NSObject
Declared in PXStyler.h

Overview

The PXStyler protocol is a collection of methods used to apply styles defined in a PXRuleSet to a PXStyleable object. Stylers have four phases:

  1. setup
  2. compute styles
  3. apply styles
  4. clean up

The setup and cleanup stages are optional and only need to be used if state needs to be initialized before computing style information or if that state needs to be cleared once styling has completed.

The compute styles phase extracts information from a ruleSet and may use the view to be styled when performing those calcuations.

The apply styles phase creates any instances needed for styling and applies these to the PXStyleable instance.

Tasks

  •   supportedProperties

    The list of properties supported by this styler

    property required method
  • – processDeclaration:withContext:

    Calcuate styling information using the specified declaration. This will be called once for each property name supported by the styler.

    required method
  • – applyStylesWithContext:

    Apply the computed styles to the specified view. Note that it is expected that computeStylesForView:withRuleSet: has already been called.

    required method

Properties

supportedProperties

The list of properties supported by this styler

@property (nonatomic, readonly) NSArray *supportedProperties

Discussion

The list of properties supported by this styler

Declared In

PXStyler.h

Instance Methods

applyStylesWithContext:

Apply the computed styles to the specified view. Note that it is expected that computeStylesForView:withRuleSet: has already been called.

- (void)applyStylesWithContext:(PXStylerContext *)context

Parameters

context

The styler context

Discussion

Apply the computed styles to the specified view. Note that it is expected that computeStylesForView:withRuleSet: has already been called.

Declared In

PXStyler.h

processDeclaration:withContext:

Calcuate styling information using the specified declaration. This will be called once for each property name supported by the styler.

- (void)processDeclaration:(PXDeclaration *)declaration withContext:(PXStylerContext *)context

Parameters

declaration

The declaration to process

context

The styler context

Discussion

Calcuate styling information using the specified declaration. This will be called once for each property name supported by the styler.

Declared In

PXStyler.h