Extensions

The following extensions are available globally.

  • Extends String to support the Action Data controls and adds convenience methods for working with UIImage and UIColor properties in a Codable, Encodable or Decodable class.

    Examples:

    // Get the hex representation of a color in iOS, tvOS and watchOS.
    let hex: String ~= UIColor.white
    
    See more

    Declaration

    Swift

    struct String
  • Extends UIImage to support the Action Data controls and adds convenience methods for working with image properties in a Codable, Encodable or Decodable class.

    Examples:

    // Assign aa image from Base 64 encoded String in iOS, tvOS or watchOS
    let imageString = UIImage(named: "Background.png").toString()
    let image: UIImage ~= imageString
    
    See more
  • Extends Data to support the Action Data controls and adds convenience methods for working with data properties in a Codable, Encodable or Decodable class.

    Examples:

    // Assign data from an image in iOS, tvOS or watchOS
    let imageData: Data ~= UIImage(named: "Background.png")
    
    See more
  • Extends UIColor to support the Action Data controls and adds convenience methods for working with colors in a Codable, Encodable or Decodable class.

    iOS, tvOS and watchOS Examples:

    // 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()
    
    See more