BPKIcon
@interface BPKIcon : NSObject
This class encapsulates all Backpack icons and the ability to render them as UIImage. It
leverages a NSCache to prevent excessive performance impact when using the same icon many
times. Further the use of NSCache means that in low memory scenarios the cache will be cleared
to allow more important memory use.
-
A dictionary mapping icon names to the unicode code point in the icon font of the icon.
Declaration
Objective-C
@property (class, nonatomic, readonly, nullable) NSDictionary<BPKIconName, NSString *> *iconMapping;Swift
class var iconMapping: [BPKIconName : String]? { get } -
The concrete point size for a small icon.
Declaration
Objective-C
@property (class, readonly) CGSize concreteSizeForSmallIcon;Swift
class var concreteSizeForSmallIcon: Size { get } -
The concrete point size for a large icon.
Declaration
Objective-C
@property (class, readonly) CGSize concreteSizeForLargeIcon;Swift
class var concreteSizeForLargeIcon: Size { get } -
The concrete point size for a extra-large icon.
Declaration
Objective-C
@property (class, readonly) CGSize concreteSizeForXlIcon;Swift
class var concreteSizeForXlIcon: Size { get } -
DEPRECATED. USE
smallTemplateIconNamed:..., ORlargeTemplateIconNamed:...INSTEAD Render a given icon as a UIImage for use as a template, i.e. withrenderModeset toUIImageRenderingModeAlwaysTemplate.Declaration
Objective-C
+ (nonnull UIImage *)templateIconNamed:(nonnull BPKIconName)name size:(BPKIconSize)size;Swift
class func makeTemplateIcon(name: BPKIconName, size: BPKIconSize) -> UIImageParameters
nameThe name of the icon e.g. “flight”.
sizeThe size to render the icon in.
Return Value
The rendered icon as a
UIImagein template mode. -
DEPRECATED. USE
smallIconNamed:..., ORlargeIconNamed:...INSTEAD Render a given icon as a UIImage.Declaration
Objective-C
+ (nonnull UIImage *)iconNamed:(nonnull BPKIconName)name color:(nonnull UIColor *)color size:(BPKIconSize)size;Swift
class func makeIcon(name: BPKIconName, color: Any!, size: BPKIconSize) -> UIImageParameters
nameThe name of the icon e.g. “flight”.
colorThe color to render the icon in.
sizeThe size to render the icon in.
Return Value
The rendered icon as a
UIImage. -
Calculates the concrete point size a given BPKIconSize.
Declaration
Objective-C
+ (CGSize)concreteSizeForIconSize:(BPKIconSize)size;Swift
class func concreteSize(forSize size: BPKIconSize) -> Any!Parameters
sizeThe size for which to calculate the concrete size.
Return Value
The concerete point size for the given size.
-
Render a given small icon as a UIImage for use as a template, i.e. with
renderModeset toUIImageRenderingModeAlwaysTemplate.Declaration
Objective-C
+ (nonnull UIImage *)smallTemplateIconNamed:(nonnull BPKSmallIconName)name;Swift
class func makeSmallTemplateIcon(name: BPKSmallIconName) -> UIImageParameters
nameThe name of the icon e.g. “flight”.
Return Value
The rendered icon as a
UIImagein template mode. -
Render a given large icon as a UIImage for use as a template, i.e. with
renderModeset toUIImageRenderingModeAlwaysTemplate.Declaration
Objective-C
+ (nonnull UIImage *)largeTemplateIconNamed:(nonnull BPKLargeIconName)name;Swift
class func makeLargeTemplateIcon(name: BPKLargeIconName) -> UIImageParameters
nameThe name of the icon e.g. “flight”.
Return Value
The rendered icon as a
UIImagein template mode. -
Render a given extra-large icon as a UIImage for use as a template, i.e. with
renderModeset toUIImageRenderingModeAlwaysTemplate.Declaration
Objective-C
+ (nonnull UIImage *)xlTemplateIconNamed:(nonnull BPKXlIconName)name;Swift
class func makeXlTemplateIcon(name: BPKXlIconName) -> UIImageParameters
nameThe name of the icon e.g. “flight”.
Return Value
The rendered icon as a
UIImagein template mode. -
Render a given small icon as a UIImage.
Declaration
Objective-C
+ (nonnull UIImage *)smallIconNamed:(nonnull BPKSmallIconName)name color:(nonnull UIColor *)color;Swift
class func makeSmallIcon(name: BPKSmallIconName, color: Any!) -> UIImageParameters
nameThe name of the icon e.g. “flight”.
colorThe color to render the icon in.
Return Value
The rendered icon as a
UIImage. -
Render a given large icon as a UIImage.
Declaration
Objective-C
+ (nonnull UIImage *)largeIconNamed:(nonnull BPKLargeIconName)name color:(nonnull UIColor *)color;Swift
class func makeLargeIcon(name: BPKLargeIconName, color: Any!) -> UIImageParameters
nameThe name of the icon e.g. “flight”.
colorThe color to render the icon in.
Return Value
The rendered icon as a
UIImage. -
Render a given small icon as a UIImage.
Declaration
Objective-C
+ (nonnull UIImage *)xlIconNamed:(nonnull BPKXlIconName)name color:(nonnull UIColor *)color;Swift
class func makeXlIcon(name: BPKXlIconName, color: Any!) -> UIImageParameters
nameThe name of the icon e.g. “flight”.
colorThe color to render the icon in.
Return Value
The rendered icon as a
UIImage.
BPKIcon Class Reference