mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Introduce typed accesses for the error types of AVFoundation, CloudKit, Contacts, and CoreLocation. While here, fix the API notes for the Contacts framework, which had an embarrassingly-wrong file name ;)
42 lines
940 B
Swift
42 lines
940 B
Swift
@_exported import AVFoundation // Clang module
|
|
import Foundation
|
|
|
|
|
|
extension AVError {
|
|
/// The device name.
|
|
public var device: String? {
|
|
return userInfo[AVErrorDeviceKey] as? String
|
|
}
|
|
|
|
/// The time.
|
|
public var time: CMTime? {
|
|
return userInfo[AVErrorTimeKey] as? CMTime
|
|
}
|
|
|
|
/// The file size.
|
|
public var fileSize: Int64? {
|
|
return (userInfo[AVErrorFileSizeKey] as? NSNumber)?.int64Value
|
|
}
|
|
|
|
/// The process ID number.
|
|
public var processID: Int? {
|
|
return userInfo[AVErrorPIDKey] as? Int
|
|
}
|
|
|
|
/// Whether the recording successfully finished.
|
|
public var recordingSuccessfullyFinished: Bool? {
|
|
return userInfo[AVErrorRecordingSuccessfullyFinishedKey] as? Bool
|
|
}
|
|
|
|
/// The media type.
|
|
public var mediaType: String? {
|
|
return userInfo[AVErrorMediaTypeKey] as? String
|
|
}
|
|
|
|
/// The media subtypes.
|
|
public var mediaSubtypes: [Int]? {
|
|
return userInfo[AVErrorMediaSubTypeKey] as? [Int]
|
|
}
|
|
}
|
|
|