IconGenerator
@available(iOS 9.0, *)
@objcMembers
@objc(PESDKIconGenerator)
open class IconGenerator : NSObject
An icon generator can be used to generate various icons.
-
Generates the icon used to display a string.
Declaration
Swift
@objc(generateTextImageWithFont:ofSize:text:) open class func generateTextImage(with font: UIFont, of size: CGSize, text: String = "Ag") -> UIImage?
Parameters
font
The font that should be used in the icon.
size
The size of the icon that is generated.
text
The text in the icon.
Return Value
An image of the given string with the given size.
-
Generates the icon used to display a color in the menu.
Declaration
Swift
@objc(generateColorImageWithColor:borderColor:ofSize:) open class func generateColorImage(with color: UIColor, border borderColor: UIColor, of size: CGSize) -> UIImage?
Parameters
color
The color that should be displayed.
borderColor
The color of the border.
size
The size of the generated image.
Return Value
An icon that can be used to display a color in the menu.