<!--
{
  "availability" : [
    "Xcode: 27.0.0 -",
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Evaluations",
  "identifier" : "/documentation/Evaluations/ScoringScale",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Evaluations"
    ],
    "preciseIdentifier" : "s:11Evaluations12ScoringScaleV"
  },
  "title" : "ScoringScale"
}
-->

# ScoringScale

A scoring scale that defines the set of options a judge can assign.

```
struct ScoringScale
```

## Overview

Use the factory methods to create scales from numeric dictionaries, pass or fail pairs,
or typed [`ScoreLevel`](/documentation/Evaluations/ScoreLevel) enums:

```swift
// Numeric scale
let _ = ScoringScale.numeric([5: "Flawless", 3: "Readable", 1: "Incomprehensible"])

// Pass or fail
let _ = ScoringScale.passFail(passDescription: "Safe", failDescription: "Unsafe")

// Typed enum
enum SafetyLevel: ScoreLevel {
    case safe, unsafe
    var guideDescription: String { self == .safe ? "Safe" : "Unsafe" }
    var value: Double { self == .safe ? 1 : 0 }
}
let _ = ScoringScale.custom(SafetyLevel.self)
```

## Topics

### Creating a scale

[`static func passFail(passDescription: String, failDescription: String) -> ScoringScale`](/documentation/Evaluations/ScoringScale/passFail(passDescription:failDescription:))

Creates a binary pass or fail scoring scale.

[`static func numeric([Double : String]) -> ScoringScale`](/documentation/Evaluations/ScoringScale/numeric(_:))

Creates a scoring scale from a numeric dictionary.

[`static func custom<Level>(Level.Type) -> ScoringScale`](/documentation/Evaluations/ScoringScale/custom(_:))

Creates a scoring scale from a typed score level enum.

[`init(options: [ScaleOption])`](/documentation/Evaluations/ScoringScale/init(options:))

Creates a scoring scale with explicit options.

### Inspecting a scale

[`let options: [ScaleOption]`](/documentation/Evaluations/ScoringScale/options)

The scale options, ordered from highest to lowest value.

[`struct ScaleOption`](/documentation/Evaluations/ScaleOption)

A single option in a scoring scale.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)