PROTOCOL

UIStylableThemeDelegate

public protocol UIStylableThemeDelegate: AnyObject

The UI Stylable Theme delegate defines the callback interface for UIViewControllers used to dynamically load theme styles and UI resources.

Properties

commonStyle

var commonStyle: HaapiUIViewControllerStyle

Returns the common style definitions for components used in HaapiUIViewController.

Methods

imageOptional(named:)

func imageOptional(named: String?) -> UIImage?

Returns an image object using the named image asset. If there is no correspondance thennil is returned.

Parameters

Name Description
named The name of the image asset or file. For images in asset catalogs, specify the name of the image asset. For PNG image files, specify the filename without the filename extension. For all other image file formats, include the filename extension in the name.

styleOrThrowFor(stylableType:)

func styleOrThrowFor<U: UIStyle>(stylableType: any UIStylable.Type) throws -> U

Returns the style for an object which conforms to UIStylable.

Parameters

Name Description
stylableType An object which conforms to UIStylable.

styleFor(stylableType:)

func styleFor<U: UIStyle>(stylableType: any UIStylable.Type) -> U

Returns the style for an object which conforms to UIStylable.

Parameters

Name Description
stylableType An object which conforms to UIStylable.

colorOptional(named:)

func colorOptional(named: String?) -> UIColor?

Returns a color object using the named asset. If the color object is not present in the defined bundle then it will try to return a color object in the framework bundle. Otherwise, nil is returned.

Parameters

Name Description
named The name of the asset containing the color.

localizedStringForKey(key:)

func localizedStringForKey(key: String) -> String

Returns a localized string for the given key. If the localized string is not present in the app bundle then it will try to return a localized string in the framework bundle. Otherwise, key is returned.

Parameters

Name Description
key The key for the localized string.