Mutator

public protocol Mutator : class

Defines a protocol for mutating the structure of a Block.

  • The block that should be mutated by this mutator.

    Declaration

    Swift

    weak var block: Block?
  • The layout associated with this mutator.

    Declaration

    Swift

    weak var layout: MutatorLayout?
  • Mutates self.block based on this mutator’s internal state.

    This mutation is not additive, so any previously applied mutation should not be reflected on self.block.

    Throws

    Throws an error if the block could not be mutated.

    Declaration

    Swift

    func mutateBlock() throws
  • Returns the XML based on this mutator’s internal state, which will be included as a direct child of the exported XML for self.block.

    Declaration

    Swift

    func toXMLElement() -> AEXMLElement

    Return Value

    An AEXMLElement object representing this mutator’s internal state.

  • Updates this mutator’s internal state, using the XML from the block.

    Note

    This method call does not actually mutate the block. mutateBlock() must be explicitly called after this.

    Declaration

    Swift

    func update(fromXML xml: AEXMLElement)
  • Returns a copy of this mutator.

    Declaration

    Swift

    func copyMutator() -> Mutator

    Return Value

    A new copy of this mutator, but with its block property set to nil.