PXStyler Protocol Reference
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:
- setup
- compute styles
- apply styles
- 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
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