Extensions
The following extensions are available globally.
-
Extends
String
to support the Action Data controls and adds convenience methods for working withNSImage
andNSColor
properties in aCodable
,Encodable
orDecodable
class.Examples:
See more// Get the hex representation of a color in macOS. let hex: String ~= NSColor.white
Declaration
Swift
struct String
-
Extends
See moreNSBitmapImageRep
to support the Action Data controls and adds convenience methods for working with image properties in aCodable
,Encodable
orDecodable
class. -
Extends
NSImage
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 macOS let imageString = NSImage(named: "Background.png").toString() let image: NSImage ~= 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 macOS let imageData: Data ~= NSImage(named: "Background.png")
-
Extends
NSColor
to support the Action Data controls and adds convenience methods for working with colors in aCodable
,Encodable
orDecodable
class.Examples:
See more// Assign a color from a string let color: NSColor ~= "#FF0000" // Initialize a color from a hex string let green = NSColor(fromHex: "00FF00") // Convert color to a hex string let white = NSColor.white.toHex()