29 var _CPAppearanceCurrent = nil,
30 _CPAppearancesRegistry = @{};
65 #pragma mark Class Methods 71 if (!_CPAppearanceCurrent)
74 return _CPAppearanceCurrent;
82 _CPAppearanceCurrent = anAppearance;
90 if (![_CPAppearancesRegistry containsKey:aName])
96 return [_CPAppearancesRegistry objectForKey:aName];
101 #pragma mark Initialization 108 if (
self = [super
init])
111 _allowsVibrancy = YES;
113 if ([_CPAppearancesRegistry containsKey:aName])
114 [
CPException raise:CPInternalInconsistencyException
reason:"Appearance with name '" + aName + "' is already declared."];
116 [_CPAppearancesRegistry setObject:self forKey:aName];
124 #pragma mark Implementation 131 return self._name == anObject._name;
136 return @"<CPAppearance @" + [
self UID] +
@" name: " + _name +
">";
141 #pragma mark CPCoding 145 if (
self = [super
init])
147 _name = [aCoder decodeObjectForKey:@"_name"];
148 _allowsVibrancy = [aCoder decodeBoolForKey:@"_allowsVibrancy"];
156 [aCoder encodeObject:_name forKey:@"_name"];
157 [aCoder encodeBool:_allowsVibrancy forKey:@"_allowsVibrancy"];
167 - (BOOL)allowsVibrancy
169 return _allowsVibrancy;
175 - (void)setAllowsVibrancy:(BOOL)aValue
177 _allowsVibrancy = aValue;
Used to implement exception handling (creating & raising).
CPThemeStateAppearanceVibrantDark
void raise:reason:(CPString aName, [reason] CPString aReason)
id initWithAppearanceNamed:bundle:(CPString aName, [bundle] CPBundle bundle)
An immutable string (collection of characters).
CPAppearance appearanceNamed:(CPString aName)
CPThemeStateAppearanceVibrantLight
CPThemeStateAppearanceLightContent
CPThemeStateAppearanceAqua
CPAppearanceNameLightContent
CPAppearanceNameVibrantDark
Defines methods for use when archiving & restoring (enc/decoding).
CPAppearanceNameVibrantLight
FrameUpdater prototype description