A category describing why the system terminated the application.
Each category corresponds to a termination count property on
``ForegroundTerminationMetric`` or ``BackgroundTerminationMetric``.
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 27.0+
taskTimeout
TypeScript
get taskTimeout(): CrashDiagnostic_TerminationCategory
Swift declaration
static let taskTimeout: CrashDiagnostic.TerminationCategory
The app was terminated for exceeding the allocated time for a background task.
Corresponds to ``BackgroundTerminationMetric/taskTimeoutTerminationCount``.
get · iOS 27.0+
illegalInstruction
TypeScript
get illegalInstruction(): CrashDiagnostic_TerminationCategory
Swift declaration
static let illegalInstruction: CrashDiagnostic.TerminationCategory
The app was terminated for executing an illegal or undefined instruction.
Corresponds to ``ForegroundTerminationMetric/illegalInstructionTerminationCount``
and ``BackgroundTerminationMetric/illegalInstructionTerminationCount``.
get · iOS 27.0+
abnormal
TypeScript
get abnormal(): CrashDiagnostic_TerminationCategory
Swift declaration
static let abnormal: CrashDiagnostic.TerminationCategory
The app terminated abnormally, typically due to an uncaught exception or call to `abort()`.
Corresponds to ``ForegroundTerminationMetric/abnormalTerminationCount``
and ``BackgroundTerminationMetric/abnormalTerminationCount``.
get · iOS 27.0+
fileLock
TypeScript
get fileLock(): CrashDiagnostic_TerminationCategory
Swift declaration
static let fileLock: CrashDiagnostic.TerminationCategory
The app was terminated while suspended for holding file locks.
Corresponds to ``BackgroundTerminationMetric/fileLockTerminationCount``.
Creates a new instance with the specified raw value.
If there is no value of the type that corresponds with the specified raw
value, this initializer returns `nil`. For example:
enum PaperSize: String {
case A4, A5, Letter, Legal
}
print(PaperSize(rawValue: "Legal"))
// Prints "Optional(PaperSize.Legal)"
print(PaperSize(rawValue: "Tabloid"))
// Prints "nil"
- Parameter rawValue: The raw value to use for the new instance.
The corresponding value of the raw type.
A new instance initialized with `rawValue` will be equivalent to this
instance. For example:
enum PaperSize: String {
case A4, A5, Letter, Legal
}
let selectedSize = PaperSize.Letter
print(selectedSize.rawValue)
// Prints "Letter"
print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
// Prints "true"
get · iOS 27.0+
watchdog
TypeScript
get watchdog(): CrashDiagnostic_TerminationCategory
Swift declaration
static let watchdog: CrashDiagnostic.TerminationCategory
The app was terminated by the system watchdog for failing to respond in time.
Corresponds to ``ForegroundTerminationMetric/watchdogTerminationCount``
and ``BackgroundTerminationMetric/watchdogTerminationCount``.
get · iOS 27.0+
badAccess
TypeScript
get badAccess(): CrashDiagnostic_TerminationCategory
Swift declaration
static let badAccess: CrashDiagnostic.TerminationCategory
The app was terminated for attempting an invalid memory access.
Corresponds to ``ForegroundTerminationMetric/badAccessTerminationCount``
and ``BackgroundTerminationMetric/badAccessTerminationCount``.