# ResultCategory

    class ResultCategory: NSObject

Category is a util class that contains a label, its display name, a float value as score, and the index of the label in the corresponding label file. Typically it's used as the result of classification tasks.
- `
  ### [init(index:score:categoryName:displayName:)](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/ResultCategory.md.txt#/c:objc(cs)MPPCategory(im)initWithIndex:score:categoryName:displayName:)

  ` Initializes a new `ResultCategory` with the given index, score, category name and display name.

  #### Declaration

  Swift

      init(index: Int, score: Float, categoryName: String?, displayName: String?)

  #### Parameters

  |---|---|
  | `index` | The index of the label in the corresponding label file. |
  | `score` | The probability score of this label category. |
  | `categoryName` | The label of this category object. |
  | `displayName` | The display name of the label. |

  #### Return Value

  An instance of `ResultCategory` initialized with the given index, score, category name and display name.
- `
  ### [categoryName](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/ResultCategory.md.txt#/c:objc(cs)MPPCategory(py)categoryName)

  ` The label of this category object.

  #### Declaration

  Swift

      var categoryName: String? { get }

- `
  ### [displayName](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/ResultCategory.md.txt#/c:objc(cs)MPPCategory(py)displayName)

  ` The display name of the label, which may be translated for different locales. For example, a label, "apple", may be translated into Spanish for display purpose, so that the display name is "manzana".

  #### Declaration

  Swift

      var displayName: String? { get }

- `
  ### [index](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/ResultCategory.md.txt#/c:objc(cs)MPPCategory(py)index)

  ` The index of the label in the corresponding label file. Set to -1 if the index is not set.

  #### Declaration

  Swift

      var index: Int { get }

- `
  ### [score](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/ResultCategory.md.txt#/c:objc(cs)MPPCategory(py)score)

  ` Confidence score for this class.

  #### Declaration

  Swift

      var score: Float { get }