Entry

public class Entry : NSObject

Once one Rule runs on a list of views, each analyzed view can be described by one of four Statuses: Pass, Violation, Inapplicable, or Incomplete. An Entry holds all of the views for one of these Statuses.

  • The Rule that was run.

    Declaration

    Swift

    public let ruleId: RuleID
  • The description of the Rule that was run, which may include information about why the violation is important to consider.

    Declaration

    Swift

    public let ruleDescription: String
  • A website that can be visited for help regarding fixing a violation.

    Declaration

    Swift

    public let ruleHelpUrl: String
  • Is the same as the description of the Rule in this context.

    Declaration

    Swift

    public let ruleHelpText: String
  • Initializing the Entry with a Rule.

    Declaration

    Swift

    public init(id: RuleID)

    Parameters

    id

    RuleID, the ID of the Rule to which the Entry pertains.

  • Adding the information from the Entry into a Dictionary for use elsewhere.

    Declaration

    Swift

    public func toAxeViolation() -> Dictionary<String, Any>

    Return Value

    An NSDictionary. It contains:

    • the Rule ID
    • the Rule’s description
    • A helpful website for more information on the violation
    • Various tags
    • The list of views in this Rule that are of the same Status
    • The severity of its violation

  • The severity of the violation in the Entry. The Impact may be one of the following:

    • Impact.Pass
    • Impact.Minor
    • Impact.Moderate
    • Impact.Serious
    • Impact.Critical

    Declaration

    Swift

    public var impact: Impact
  • An array of views that are of the same Status.

    Declaration

    Swift

    public var nodes: [Node]
  • Print a description of the Entry in the way defined in the printer parameter.

    Declaration

    Swift

    public func description(printer: (Entry) -> String) -> String

    Parameters

    printer

    A function that takes in an Entry as a parameter and returns a String. This function should convert the information desired from the Entry to a String.

    Return Value

    String containing the desired information.

  • String containing all of the information in an Entry. Prints it in a clean, easy-to-read format. It contains:

    • Name of the Rule and its description
    • URL for further information on the Rule
    • Description of each of the views that fall into this Status for this Rule

    Declaration

    Swift

    override public var description: String