FieldVariableLayout

@objcMembers open class FieldVariableLayout: FieldLayout

Class for a FieldVariable-based Layout.

  • Represents a selectable variable, with a display name and underlying value.

    Declaration

    Swift

    public typealias Option = (displayName: String, value: String)
  • The list of all variable options that should be presented when rendering this layout

    Declaration

    Swift

    open var variables: [Option]
  • The currently selected variable

    Declaration

    Swift

    open var variable: String
  • Optional name manager that this field is scoped to.

    Declaration

    Swift

    public weak var nameManager: NameManager?
  • Changes self.fieldVariable.variable to use the given value. If the value was changed, the layout tree is updated to reflect the change.

    Declaration

    Swift

    open func changeToExistingVariable(_ variable: String)
  • Renames the variable on this layout to a new value, and tells the NameManager of the change.

    Declaration

    Swift

    open func renameVariable(to newName: String)
  • Removes the variable that’s currently stored on this layout.

    Declaration

    Swift

    open func removeVariable()
  • Checks whether a string is a valid name.

    Declaration

    Swift

    public func isValidName(_ name: String) -> Bool
  • Returns the total number of variables matching the variable set on this layout.

    Declaration

    Swift

    public func numberOfVariableReferences() -> Int

    Return Value

    The count of variable fields.