RBThemeTracker Class Reference
Inherits from | RBPropertyListTracker : NSObject |
---|---|
Declared in | RBThemeTracker.h |
delegate
The delegate to receive theme tracking events.
@property (nonatomic, readonly, weak, nullable) id<RBThemeTrackerDelegate> delegate
Discussion
The delegate to receive theme tracking events.
Declared In
RBThemeTracker.h
classification
The Class
of the associated object if the object is subclass of UIView
or UIViewController
. It is nil
otherwise.
@property (nonatomic, readonly, nullable) Class classification
Discussion
The Class
of the associated object if the object is subclass of UIView
or UIViewController
. It is nil
otherwise.
Declared In
RBThemeTracker.h
identifier
The theme identifier from which to extract theme information from.
Setting this will remove all previous custom overrides as well as removing the class theme (if any).
If this is set to nil
or if the identifier did not return a theme the default class theme (if any) will resume being used.
@property (nonatomic, nullable) NSString *identifier
Discussion
The theme identifier from which to extract theme information from.
Setting this will remove all previous custom overrides as well as removing the class theme (if any).
If this is set to nil
or if the identifier did not return a theme the default class theme (if any) will resume being used.
Declared In
RBThemeTracker.h
shouldAutoApplyOnFirstAppearance
Indicates that the theming for the associated object should be applied automatically. Default YES
.
For UIView
and subclass objects the didMoveToSuperView method is utilised by Redbeard and theming is applied when this event occurs.
For UIViewController
and subclass objects the viewWillAppear method is utilised by Redbeard and theming is applied when this event occurs.
In other cases this has no affect (it applies only to UIView
and UIViewController
).
@property (nonatomic) BOOL shouldAutoApplyOnFirstAppearance
Discussion
Indicates that the theming for the associated object should be applied automatically. Default YES
.
For UIView
and subclass objects the didMoveToSuperView method is utilised by Redbeard and theming is applied when this event occurs.
For UIViewController
and subclass objects the viewWillAppear method is utilised by Redbeard and theming is applied when this event occurs.
In other cases this has no affect (it applies only to UIView
and UIViewController
).
Declared In
RBThemeTracker.h
didApplyOnFirstAppearance
Used and set internally after the theme has been applied automatically on appearing.
@property (nonatomic) BOOL didApplyOnFirstAppearance
Discussion
Used and set internally after the theme has been applied automatically on appearing.
Declared In
RBThemeTracker.h
disableTheming
Disables any further theming from being applied. This causes the processChange:
from having any effect. Default NO
.
NB. it is the processChange:
method that calls the delegates applyTheme:
method when there are changings awaiting to be processed.
@property (nonatomic) BOOL disableTheming
Discussion
Disables any further theming from being applied. This causes the processChange:
from having any effect. Default NO
.
NB. it is the processChange:
method that calls the delegates applyTheme:
method when there are changings awaiting to be processed.
Declared In
RBThemeTracker.h
– initWithClassification:delegate:
Initializes a new theme tracker with the given class and delegate.
- (nonnull instancetype)initWithClassification:(nonnull Class)classification delegate:(nonnull id<RBThemeTrackerDelegate>)delegate
Parameters
classification |
The |
---|---|
delegate |
The delegate to receive theme tracking events. |
Return Value
The initialized object.
Discussion
Initializes a new theme tracker with the given class and delegate.
Declared In
RBThemeTracker.h
– initWithDelegate:
Initializes a new theme tracker with the given delegate.
- (nonnull instancetype)initWithDelegate:(nonnull id<RBThemeTrackerDelegate>)delegate
Parameters
delegate |
The delegate to receive theme tracking events. |
---|
Return Value
The initialized object.
Discussion
Initializes a new theme tracker with the given delegate.
Declared In
RBThemeTracker.h
– applyChanges:
Convenience method that pushes a theme change and processes the change. Simply calls pushChanges followed by processChanges.
- (void)applyChanges:(nullable NSDictionary<NSString*,id> *)changes
Parameters
changes |
The theme to merge. |
---|
Discussion
Convenience method that pushes a theme change and processes the change. Simply calls pushChanges followed by processChanges.
Declared In
RBThemeTracker.h
– apply
Manually applies the full theme (using the value of the currentStateThemeKey if available).
- (void)apply
Discussion
Manually applies the full theme (using the value of the currentStateThemeKey if available).
Declared In
RBThemeTracker.h
– reset
Resets theming removing all theming values and then reloads as normal via class theme and then via identifier. Note any custom theming values that may have been previously applied will of course no longer be set.
- (void)reset
Discussion
Resets theming removing all theming values and then reloads as normal via class theme and then via identifier. Note any custom theming values that may have been previously applied will of course no longer be set.
Declared In
RBThemeTracker.h
– clear
Removes all theming values that may currently be present.
- (void)clear
Discussion
Removes all theming values that may currently be present.
Declared In
RBThemeTracker.h
currentStateThemeKey
The key of the current activated state of the theme - or nil
if in the normal state.
@property (nonatomic, readonly, nullable) NSString *currentStateThemeKey
Discussion
The key of the current activated state of the theme - or nil
if in the normal state.
Declared In
RBThemeTracker.h
– applyNormalStateTheme
Applies the normal state of the theme.
- (void)applyNormalStateTheme
Discussion
Applies the normal state of the theme.
Declared In
RBThemeTracker.h
– applyCurrentState
Re-applies the current state of the theme.
- (void)applyCurrentState
Discussion
Re-applies the current state of the theme.
Declared In
RBThemeTracker.h
– applyStateThemeWithKey:
Applies the given state theme.
- (void)applyStateThemeWithKey:(nonnull NSString *)key
Parameters
key |
The unique key of the state. |
---|
Discussion
Applies the given state theme.
Declared In
RBThemeTracker.h