Structure

NSError.UserInfoKey

These keys may exist in the user info dictionary.

Declaration

iOS, macOS, Mac Catalyst, tvOS, watchOS
struct ErrorUserInfoKey
iOS, macOS, Mac Catalyst, tvOS, watchOS
typealias UserInfoKey = NSString

Topics

Constants

let NSURLErrorKey: String

The corresponding value is an NSURL object.

let NSFilePathErrorKey: String

Contains the file path of the error.

let NSHelpAnchorErrorKey: String

The corresponding value is an NSString containing the localized help corresponding to the help button. See helpAnchor for more information.

let NSLocalizedDescriptionKey: String

The corresponding value is a localized string representation of the error that, if present, will be returned by localizedDescription.

let NSLocalizedFailureReasonErrorKey: String

The corresponding value is a localized string representation containing the reason for the failure that, if present, will be returned by localizedFailureReason.

let NSLocalizedRecoveryOptionsErrorKey: String

The corresponding value is an array containing the localized titles of buttons appropriate for displaying in an alert panel.

let NSLocalizedRecoverySuggestionErrorKey: String

The corresponding value is a string containing the localized recovery suggestion for the error.

let NSRecoveryAttempterErrorKey: String

The corresponding value is an object that conforms to the NSErrorRecoveryAttempting informal protocol.

let NSStringEncodingErrorKey: String

The corresponding value is an NSNumber object containing the NSStringEncoding value.

let NSUnderlyingErrorKey: String

The corresponding value is an error that was encountered in an underlying implementation and caused the error that the receiver represents to occur.

Operator Functions

static func != (ErrorUserInfoKey, ErrorUserInfoKey) -> Bool

Returns a Boolean value indicating whether two values are not equal.

Relationships

See Also

Providing Error User Info

class func setUserInfoValueProvider(forDomain: String, provider: ((Error, String) -> Any?)?)

Specifies a block to call when the corresponding property is not present in the user info dictionary.

class func userInfoValueProvider(forDomain: String) -> ((Error, String) -> Any?)?

Returns any user info provider specified for a given error domain.