Extensions
The following extensions are available globally.
-
Extends
String
to support the Action Data controls and adds convenience methods for working withUIImage
andUIColor
properties in aCodable
,Encodable
orDecodable
class.Examples:
See more// Get the hex representation of a color in iOS, tvOS and watchOS. let hex: String ~= UIColor.white
Declaration
Swift
struct String
-
Extends
UIImage
to support the Action Data controls and adds convenience methods for working with image properties in aCodable
,Encodable
orDecodable
class.Examples:
See more// Assign aa image from Base 64 encoded String in iOS, tvOS or watchOS let imageString = UIImage(named: "Background.png").toString() let image: UIImage ~= imageString
-
Extends
Data
to support the Action Data controls and adds convenience methods for working with data properties in aCodable
,Encodable
orDecodable
class.Examples:
See more// Assign data from an image in iOS, tvOS or watchOS let imageData: Data ~= UIImage(named: "Background.png")
-
Extends
UIColor
to support the Action Data controls and adds convenience methods for working with colors in aCodable
,Encodable
orDecodable
class.iOS, tvOS and watchOS Examples:
See more// Assign a color from a string let color: UIColor ~= "#FF0000" // Initialize a color from a hex string let green = UIColor(fromHex: "00FF00") // Convert color to a hex string let white = UIColor.white.toHex()