Files
swift-mirror/stdlib/public/SDK/AVFoundation/AVFoundation.swift
Doug Gregor cb8ec8714a [SE-0112] Add typed accessors for various error types and keys.
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 ;)
2016-07-12 19:41:52 -07:00

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]
}
}