SCAppearanceConfiguration Class Reference

Inherits from NSObject
Declared in SCAppearanceConfiguration.h

Overview

Configuration class used to customize the settings that influence the branding and coloring of UI elements used throughout the SDK.

Pass an instance of this class to the SCServiceCloud.appearanceConfiguration property on the SCServiceCloud shared instance to set the appearance.

Other Methods

  delegate

The appearance delegate, used for branding customization.

@property (nonatomic, weak, nullable) NSObject<SCAppearanceConfigurationDelegate> *delegate

Declared In

SCAppearanceConfiguration.h

  appearanceApplied

Property indicating whether any UIAppearance settings have been applied from this configuration instance.

@property (nonatomic, readonly, getter=isAppearanceApplied) BOOL appearanceApplied

Declared In

SCAppearanceConfiguration.h

– setNeedsAppearanceUpdates

Controls whether the UIAppearance selectors need to be updated.

- (void)setNeedsAppearanceUpdates

Declared In

SCAppearanceConfiguration.h

– applyAppearanceUpdatesIfNeeded

Updates the UIAppearance selectors to reflect the current state of the configuration object.

- (void)applyAppearanceUpdatesIfNeeded

Discussion

This method can be used to force appearance updates to occur at a particular time, or if there is cause for some branding changes to be reapplied.

Note: Updates are only applied if the appearance settings have indeed changed.

Declared In

SCAppearanceConfiguration.h

Knowledge Methods

  globalArticleCSS

Property for storing global CSS that will be used to customize the appearance of article content.

@property (nullable, nonatomic, copy) NSString *globalArticleCSS

Discussion

This will be appended to the built-in CSS that is produced based on the other color, and font, styles defined within this SCAppearanceConfiguration object, but before the per-article CSS resource is loaded.

See Also

  • [SCSArticleViewControllerDelegate articleController:additionalCSSForArticle:]

Declared In

SCAppearanceConfiguration+Knowledge.h

  globalArticleJavascript

Property for storing global Javascript that will be used to customize the appearance or behavior of article content.

@property (nullable, nonatomic, copy) NSString *globalArticleJavascript

Discussion

This javascript will be loaded at the end of the HTML body, but before the per-article javascript resource that may be used.

See Also

  • [SCSArticleViewControllerDelegate articleController:additionalJavascriptForArticle:]

Declared In

SCAppearanceConfiguration+Knowledge.h

Colors Methods

– setColor:forName:

Sets the color for the named SCAppearanceConfiguration constant.

- (void)setColor:(UIColor *)color forName:(SCSAppearanceColorToken)name

Parameters

color

The color to set.

name

The branding token name to set the color for.

Declared In

SCAppearanceConfiguration.h

– colorForName:

Returns the color set by the setColor:forName: method for the named SCAppearanceConfiguration constant.

- (nullable UIColor *)colorForName:(SCSAppearanceColorToken)name

Parameters

name

The branding token name to retrieve a color for.

Return Value

The color associated with that branding token, or nil if the branding token name is invalid.

Discussion

If no value has been specified, the default value is returned.

Declared In

SCAppearanceConfiguration.h

Fonts Methods

– setFontDescriptor:fontFileName:forWeight:

Sets fontDescriptor for specified weight; used to create and set the UIFont on the labels.

- (void)setFontDescriptor:(UIFontDescriptor *)fontDescriptor fontFileName:(nullable NSString *)fileName forWeight:(NSInteger)weight

Parameters

fontDescriptor

UIFontDescriptor instance to be used for creating UIFont.

fileName

Name of the font file contained in the bundle, or nil when using a built-in system font.

weight

A value from the SCFontWeight enum.

Discussion

If UIFontDescriptorSizeAttribute is set on the fontDescriptor, it is used to set the font size. If not, the SDK sets the font size appropriately.

Declared In

SCAppearanceConfiguration.h

– getFontDescriptorForWeight:

Returns the fontDescriptor for the specified weight.

- (UIFontDescriptor *)getFontDescriptorForWeight:(NSInteger)weight

Parameters

weight

A value from the SCFontWeight enum.

Discussion

If no value has been specified, the default value is returned. Default values:

  • Helvetica Neue - Light for SCFontWeightLight,
  • Helvetica Neue for SCFontWeightRegular,
  • Helvetica Neue - Semibold for SCFontWeightBold.

Declared In

SCAppearanceConfiguration.h

– getFontDescriptorForWeight:size:

Returns the fontDescriptor for the specified weight.

- (UIFontDescriptor *)getFontDescriptorForWeight:(NSInteger)weight size:(CGFloat)size

Parameters

weight

The font weight: SCFontWeightLight, SCFontWeightRegular, or SCFontWeightBold.

size

Size of the desired font

Discussion

If no value has been specified, the default value is returned. Default values:

  • San Francisco with UIFontWeightThin for SCFontWeightLight
  • San Francisco with UIFontWeightRegular for SCFontWeightRegular
  • San Francisco with UIFontWeightSemibold for SCFontWeightBold

Declared In

SCAppearanceConfiguration.h

– getFontFileNameForWeight:

Gets the font filename for a given weight.

- (nullable NSString *)getFontFileNameForWeight:(NSInteger)weight

Parameters

weight

The font weight: SCFontWeightLight, SCFontWeightRegular, or SCFontWeightBold.

Return Value

The font filename.

Declared In

SCAppearanceConfiguration.h

Images Methods

– setImage:compatibleWithTraitCollection:forName:NS_SWIFT_NAME:

Sets the image for a named SCAppearanceConfiguration constant.

- (void)setImage:(UIImage *)image compatibleWithTraitCollection:(nullable UITraitCollection *)traitCollection forName:(SCSAppearanceImageToken)name NS_SWIFT_NAME

Parameters

image

The image to set.

traitCollection

The trait collection the image will be used for, if applicable.

name

The branding token name to set the image for.

Declared In

SCAppearanceConfiguration.h

– imageForName:compatibleWithTraitCollection:NS_SWIFT_NAME:

Returns the image set by the -setImage:compatibleWithTraitCollection:forName: method for the named SCAppearanceConfiguration constant.

- (nullable UIImage *)imageForName:(SCSAppearanceImageToken)name compatibleWithTraitCollection:(nullable UITraitCollection *)traitCollection NS_SWIFT_NAME

Parameters

name

The image name to retrieve an image for.

traitCollection

The trait collection the image will be used for, if applicable.

Discussion

If no value has been specified, the default value is returned.

Declared In

SCAppearanceConfiguration.h

AttributedText Methods

– setTextAttributes:compatibleWithTraitCollection:forName:

Sets the attributed text attributes for the named SCAppearanceConfiguration constant.

- (void)setTextAttributes:(NSDictionary<NSString*,id> *)attributes compatibleWithTraitCollection:(nullable UITraitCollection *)traitCollection forName:(SCSAppearanceLabelToken)name

Parameters

attributes

The text attributes to set.

traitCollection

The trait collection these attributes will be used for, if applicable.

name

The branding token name to set the attributes for.

Declared In

SCAppearanceConfiguration.h

– textAttributesForName:compatibleWithTraitCollection:

Returns the text attribute set by the setTextAttributes:compatibleWithTraitCollection:forName: method for the named SCAppearanceConfiguration constant.

- (nullable NSDictionary<NSString*,id> *)textAttributesForName:(SCSAppearanceLabelToken)name compatibleWithTraitCollection:(nullable UITraitCollection *)traitCollection

Parameters

name

The branding token name to retrieve the attributes for.

traitCollection

The trait collection these attributes will be used for, if applicable.

Discussion

If no value has been specified, the default value is returned.

Declared In

SCAppearanceConfiguration.h