mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[gardening][Foundation] Prefer macOS over OSX for @available
This commit is contained in:
@@ -42,11 +42,11 @@ public struct Calendar : Hashable, Equatable, ReferenceConvertible, _MutableBoxi
|
||||
case republicOfChina
|
||||
|
||||
/// A simple tabular Islamic calendar using the astronomical/Thursday epoch of CE 622 July 15
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
case islamicTabular
|
||||
|
||||
/// The Islamic Umm al-Qura calendar used in Saudi Arabia. This is based on astronomical calculation, instead of tabular behavior.
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
case islamicUmmAlQura
|
||||
|
||||
}
|
||||
@@ -417,7 +417,7 @@ public struct Calendar : Hashable, Equatable, ReferenceConvertible, _MutableBoxi
|
||||
/// - parameter component: A calendar component.
|
||||
/// - parameter date: The specified date.
|
||||
/// - returns: A new `DateInterval` if the starting time and duration of a component could be calculated, otherwise `nil`.
|
||||
@available(OSX 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
public func dateInterval(of component: Component, for date: Date) -> DateInterval? {
|
||||
var start : Date = Date(timeIntervalSinceReferenceDate: 0)
|
||||
var interval : TimeInterval = 0
|
||||
@@ -694,7 +694,7 @@ public struct Calendar : Hashable, Equatable, ReferenceConvertible, _MutableBoxi
|
||||
///
|
||||
/// - parameter date: The date contained in the weekend.
|
||||
/// - returns: A `DateInterval`, or nil if the date is not in a weekend.
|
||||
@available(OSX 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
public func dateIntervalOfWeekend(containing date: Date) -> DateInterval? {
|
||||
var nsDate : NSDate?
|
||||
var ti : TimeInterval = 0
|
||||
@@ -739,7 +739,7 @@ public struct Calendar : Hashable, Equatable, ReferenceConvertible, _MutableBoxi
|
||||
/// - parameter date: The date at which to begin the search.
|
||||
/// - parameter direction: Which direction in time to search. The default value is `.forward`.
|
||||
/// - returns: A `DateInterval`, or nil if weekends do not exist in the specific calendar or locale.
|
||||
@available(OSX 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
public func nextWeekend(startingAfter date: Date, direction: SearchDirection = .forward) -> DateInterval? {
|
||||
// The implementation actually overrides previousKeepSmaller and nextKeepSmaller with matchNext, always - but strict still trumps all.
|
||||
var nsDate : NSDate?
|
||||
|
||||
@@ -216,7 +216,7 @@ public struct DateComponents : ReferenceConvertible, Hashable, Equatable, _Mutab
|
||||
/// Set the value of one of the properties, using an enumeration value instead of a property name.
|
||||
///
|
||||
/// The calendar and timeZone and isLeapMonth properties cannot be set by this method.
|
||||
@available(OSX 10.9, iOS 8.0, *)
|
||||
@available(macOS 10.9, iOS 8.0, *)
|
||||
public mutating func setValue(_ value: Int?, for component: Calendar.Component) {
|
||||
_applyMutation {
|
||||
$0.setValue(_setter(value), forComponent: Calendar._toCalendarUnit([component]))
|
||||
@@ -226,7 +226,7 @@ public struct DateComponents : ReferenceConvertible, Hashable, Equatable, _Mutab
|
||||
/// Returns the value of one of the properties, using an enumeration value instead of a property name.
|
||||
///
|
||||
/// The calendar and timeZone and isLeapMonth property values cannot be retrieved by this method.
|
||||
@available(OSX 10.9, iOS 8.0, *)
|
||||
@available(macOS 10.9, iOS 8.0, *)
|
||||
public func value(for component: Calendar.Component) -> Int? {
|
||||
return _handle.map {
|
||||
$0.value(forComponent: Calendar._toCalendarUnit([component]))
|
||||
@@ -244,7 +244,7 @@ public struct DateComponents : ReferenceConvertible, Hashable, Equatable, _Mutab
|
||||
/// If the time zone property is set in the `DateComponents`, it is used.
|
||||
///
|
||||
/// The calendar property must be set, or the result is always `false`.
|
||||
@available(OSX 10.9, iOS 8.0, *)
|
||||
@available(macOS 10.9, iOS 8.0, *)
|
||||
public var isValidDate: Bool {
|
||||
return _handle.map { $0.isValidDate }
|
||||
}
|
||||
@@ -256,7 +256,7 @@ public struct DateComponents : ReferenceConvertible, Hashable, Equatable, _Mutab
|
||||
/// Except for some trivial cases (e.g., 'seconds' should be 0 - 59 in any calendar), this method is not necessarily cheap.
|
||||
///
|
||||
/// If the time zone property is set in the `DateComponents`, it is used.
|
||||
@available(OSX 10.9, iOS 8.0, *)
|
||||
@available(macOS 10.9, iOS 8.0, *)
|
||||
public func isValidDate(in calendar: Calendar) -> Bool {
|
||||
return _handle.map { $0.isValidDate(in: calendar) }
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
import _SwiftCoreFoundationOverlayShims
|
||||
|
||||
/// DateInterval represents a closed date interval in the form of [startDate, endDate]. It is possible for the start and end dates to be the same with a duration of 0. DateInterval does not support reverse intervals i.e. intervals where the duration is less than 0 and the end date occurs earlier in time than the start date.
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
public struct DateInterval : ReferenceConvertible, Comparable, Hashable, Codable {
|
||||
public typealias ReferenceType = NSDateInterval
|
||||
|
||||
@@ -164,18 +164,18 @@ public struct DateInterval : ReferenceConvertible, Comparable, Hashable, Codable
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
public static func ==(lhs: DateInterval, rhs: DateInterval) -> Bool {
|
||||
return lhs.start == rhs.start && lhs.duration == rhs.duration
|
||||
}
|
||||
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
public static func <(lhs: DateInterval, rhs: DateInterval) -> Bool {
|
||||
return lhs.compare(rhs) == .orderedAscending
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
extension DateInterval : CustomStringConvertible, CustomDebugStringConvertible, CustomReflectable {
|
||||
public var description: String {
|
||||
return "\(start) to \(end)"
|
||||
@@ -194,7 +194,7 @@ extension DateInterval : CustomStringConvertible, CustomDebugStringConvertible,
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
extension DateInterval : _ObjectiveCBridgeable {
|
||||
public static func _getObjectiveCType() -> Any.Type {
|
||||
return NSDateInterval.self
|
||||
@@ -223,7 +223,7 @@ extension DateInterval : _ObjectiveCBridgeable {
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
extension NSDateInterval : _HasCustomAnyHashableRepresentation {
|
||||
// Must be @nonobjc to avoid infinite recursion during bridging.
|
||||
@nonobjc
|
||||
|
||||
@@ -27,7 +27,7 @@ extension FileManager {
|
||||
}
|
||||
|
||||
@available(swift, obsoleted: 4)
|
||||
@available(OSX 10.6, iOS 4.0, *)
|
||||
@available(macOS 10.6, iOS 4.0, *)
|
||||
public func replaceItemAt(_ originalItemURL: URL, withItemAt newItemURL: URL, backupItemName: String? = nil, options: FileManager.ItemReplacementOptions = []) throws -> NSURL? {
|
||||
var error: NSError?
|
||||
guard let result = __NSFileManagerReplaceItemAtURL(self, originalItemURL, newItemURL , backupItemName, options, &error) else { throw error! }
|
||||
@@ -35,14 +35,14 @@ extension FileManager {
|
||||
}
|
||||
|
||||
@available(swift, introduced: 4)
|
||||
@available(OSX 10.6, iOS 4.0, *)
|
||||
@available(macOS 10.6, iOS 4.0, *)
|
||||
public func replaceItemAt(_ originalItemURL: URL, withItemAt newItemURL: URL, backupItemName: String? = nil, options: FileManager.ItemReplacementOptions = []) throws -> URL? {
|
||||
var error: NSError?
|
||||
guard let result = __NSFileManagerReplaceItemAtURL(self, originalItemURL, newItemURL , backupItemName, options, &error) else { throw error! }
|
||||
return result
|
||||
}
|
||||
|
||||
@available(OSX 10.6, iOS 4.0, *)
|
||||
@available(macOS 10.6, iOS 4.0, *)
|
||||
@nonobjc
|
||||
public func enumerator(at url: URL, includingPropertiesForKeys keys: [URLResourceKey]?, options mask: FileManager.DirectoryEnumerationOptions = [], errorHandler handler: ((URL, Error) -> Bool)? = nil) -> FileManager.DirectoryEnumerator? {
|
||||
return __NSFileManagerEnumeratorAtURL(self, url, keys, mask, { (url, error) in
|
||||
|
||||
@@ -32,7 +32,7 @@ open class JSONEncoder {
|
||||
public static let prettyPrinted = OutputFormatting(rawValue: 1 << 0)
|
||||
|
||||
/// Produce JSON with dictionary keys sorted in lexicographic order.
|
||||
@available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
@available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
public static let sortedKeys = OutputFormatting(rawValue: 1 << 1)
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ open class JSONEncoder {
|
||||
case millisecondsSince1970
|
||||
|
||||
/// Encode the `Date` as an ISO-8601-formatted string (in RFC 3339 format).
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
case iso8601
|
||||
|
||||
/// Encode the `Date` as a string formatted by the given formatter.
|
||||
@@ -947,7 +947,7 @@ open class JSONDecoder {
|
||||
case millisecondsSince1970
|
||||
|
||||
/// Decode the `Date` as an ISO-8601-formatted string (in RFC 3339 format).
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
case iso8601
|
||||
|
||||
/// Decode the `Date` as a string parsed by the given formatter.
|
||||
@@ -2416,7 +2416,7 @@ fileprivate struct _JSONKey : CodingKey {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// NOTE: This value is implicitly lazy and _must_ be lazy. We're compiled against the latest SDK (w/ ISO8601DateFormatter), but linked against whichever Foundation the user has. ISO8601DateFormatter might not exist, so we better not hit this code path on an older OS.
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
fileprivate var _iso8601Formatter: ISO8601DateFormatter = {
|
||||
let formatter = ISO8601DateFormatter()
|
||||
formatter.formatOptions = .withInternetDateTime
|
||||
|
||||
@@ -20,7 +20,7 @@ import _SwiftCoreFoundationOverlayShims
|
||||
/// A `Measurement` is a model type that holds a `Double` value associated with a `Unit`.
|
||||
///
|
||||
/// Measurements support a large set of operators, including `+`, `-`, `*`, `/`, and a full set of comparison operators.
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
public struct Measurement<UnitType : Unit> : ReferenceConvertible, Comparable, Equatable {
|
||||
public typealias ReferenceType = NSMeasurement
|
||||
|
||||
@@ -41,7 +41,7 @@ public struct Measurement<UnitType : Unit> : ReferenceConvertible, Comparable, E
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
extension Measurement : CustomStringConvertible, CustomDebugStringConvertible, CustomReflectable {
|
||||
public var description: String {
|
||||
return "\(value) \(unit.symbol)"
|
||||
@@ -61,7 +61,7 @@ extension Measurement : CustomStringConvertible, CustomDebugStringConvertible, C
|
||||
|
||||
|
||||
/// When a `Measurement` contains a `Dimension` unit, it gains the ability to convert between the kinds of units in that dimension.
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
extension Measurement where UnitType : Dimension {
|
||||
/// Returns a new measurement created by converting to the specified unit.
|
||||
///
|
||||
@@ -117,7 +117,7 @@ extension Measurement where UnitType : Dimension {
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
extension Measurement {
|
||||
/// Add two measurements of the same Unit.
|
||||
/// - precondition: The `unit` of `lhs` and `rhs` must be `isEqual`.
|
||||
@@ -212,7 +212,7 @@ internal typealias MeasurementBridgeType = _ObjectTypeBridgeable
|
||||
internal typealias MeasurementBridgeType = _ObjectiveCBridgeable
|
||||
#endif
|
||||
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
extension Measurement : MeasurementBridgeType {
|
||||
@_semantics("convertToObjectiveC")
|
||||
public func _bridgeToObjectiveC() -> NSMeasurement {
|
||||
@@ -238,7 +238,7 @@ extension Measurement : MeasurementBridgeType {
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
extension NSMeasurement : _HasCustomAnyHashableRepresentation {
|
||||
// Must be @nonobjc to avoid infinite recursion during bridging.
|
||||
@nonobjc
|
||||
@@ -252,7 +252,7 @@ extension NSMeasurement : _HasCustomAnyHashableRepresentation {
|
||||
}
|
||||
|
||||
// This workaround is required for the time being, because Swift doesn't support covariance for Measurement (26607639)
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
extension MeasurementFormatter {
|
||||
public func string<UnitType>(from measurement: Measurement<UnitType>) -> String {
|
||||
if let result = string(for: measurement) {
|
||||
@@ -263,7 +263,7 @@ extension MeasurementFormatter {
|
||||
}
|
||||
}
|
||||
|
||||
// @available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
// @available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
// extension Unit : Codable {
|
||||
// public convenience init(from decoder: Decoder) throws {
|
||||
// let container = try decoder.singleValueContainer()
|
||||
@@ -277,7 +277,7 @@ extension MeasurementFormatter {
|
||||
// }
|
||||
// }
|
||||
|
||||
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
|
||||
extension Measurement : Codable {
|
||||
private enum CodingKeys : Int, CodingKey {
|
||||
case value
|
||||
|
||||
@@ -17,7 +17,7 @@ import _SwiftFoundationOverlayShims
|
||||
// NSCoder
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
internal func resolveError(_ error: NSError?) throws {
|
||||
if let error = error, error.code != NSCoderValueNotFoundError {
|
||||
throw error
|
||||
@@ -57,7 +57,7 @@ extension NSCoder {
|
||||
}
|
||||
|
||||
@nonobjc
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public func decodeTopLevelObject() throws -> Any? {
|
||||
var error: NSError?
|
||||
let result = __NSCoderDecodeObject(self, &error)
|
||||
@@ -72,7 +72,7 @@ extension NSCoder {
|
||||
|
||||
@nonobjc
|
||||
@available(swift, obsoleted: 4)
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public func decodeTopLevelObject(forKey key: String) throws -> AnyObject? {
|
||||
var error: NSError?
|
||||
let result = __NSCoderDecodeObjectForKey(self, key, &error)
|
||||
@@ -82,7 +82,7 @@ extension NSCoder {
|
||||
|
||||
@nonobjc
|
||||
@available(swift, introduced: 4)
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public func decodeTopLevelObject(forKey key: String) throws -> Any? {
|
||||
var error: NSError?
|
||||
let result = __NSCoderDecodeObjectForKey(self, key, &error)
|
||||
@@ -98,7 +98,7 @@ extension NSCoder {
|
||||
fatalError("This API has been renamed")
|
||||
}
|
||||
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public func decodeTopLevelObject<DecodedObjectType>(
|
||||
of cls: DecodedObjectType.Type, forKey key: String
|
||||
) throws -> DecodedObjectType?
|
||||
@@ -116,7 +116,7 @@ extension NSCoder {
|
||||
}
|
||||
|
||||
@nonobjc
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public func decodeTopLevelObject(of classes: [AnyClass]?, forKey key: String) throws -> Any? {
|
||||
var error: NSError?
|
||||
var classesAsNSObjects: NSSet?
|
||||
@@ -135,7 +135,7 @@ extension NSCoder {
|
||||
|
||||
extension NSKeyedArchiver {
|
||||
@nonobjc
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public func encodeEncodable<T : Encodable>(_ value: T, forKey key: String) throws {
|
||||
let plistEncoder = PropertyListEncoder()
|
||||
let plist = try plistEncoder.encodeToTopLevelContainer(value)
|
||||
@@ -150,7 +150,7 @@ extension NSKeyedArchiver {
|
||||
extension NSKeyedUnarchiver {
|
||||
@nonobjc
|
||||
@available(swift, obsoleted: 4)
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public class func unarchiveTopLevelObjectWithData(_ data: NSData) throws -> AnyObject? {
|
||||
var error: NSError?
|
||||
let result = __NSKeyedUnarchiverUnarchiveObject(self, data, &error)
|
||||
@@ -160,7 +160,7 @@ extension NSKeyedUnarchiver {
|
||||
|
||||
@nonobjc
|
||||
@available(swift, introduced: 4)
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public class func unarchiveTopLevelObjectWithData(_ data: Data) throws -> Any? {
|
||||
var error: NSError?
|
||||
let result = __NSKeyedUnarchiverUnarchiveObject(self, data as NSData, &error)
|
||||
@@ -169,7 +169,7 @@ extension NSKeyedUnarchiver {
|
||||
}
|
||||
|
||||
@nonobjc
|
||||
@available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
@available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
public static func unarchivedObject<DecodedObjectType>(ofClass cls: DecodedObjectType.Type, from data: Data) throws -> DecodedObjectType? {
|
||||
var error: NSError?
|
||||
let result = __NSKeyedUnarchiverSecureUnarchiveObjectOfClass(cls as! AnyClass, data, &error)
|
||||
@@ -178,7 +178,7 @@ extension NSKeyedUnarchiver {
|
||||
}
|
||||
|
||||
@nonobjc
|
||||
@available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
@available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
public static func unarchivedObject(ofClasses classes: [AnyClass], from data: Data) throws -> Any? {
|
||||
var error: NSError?
|
||||
let classesAsNSObjects = NSSet(array: classes.map { $0 as AnyObject })
|
||||
@@ -198,7 +198,7 @@ extension NSKeyedUnarchiver {
|
||||
]
|
||||
|
||||
@nonobjc
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public func decodeDecodable<T : Decodable>(_ type: T.Type, forKey key: String) -> T? {
|
||||
guard let value = self.decodeObject(of: NSKeyedUnarchiver.__plistClasses, forKey: key) else {
|
||||
return nil
|
||||
@@ -214,7 +214,7 @@ extension NSKeyedUnarchiver {
|
||||
}
|
||||
|
||||
@nonobjc
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public func decodeTopLevelDecodable<T : Decodable>(_ type: T.Type, forKey key: String) throws -> T? {
|
||||
guard let value = try self.decodeTopLevelObject(of: NSKeyedUnarchiver.__plistClasses, forKey: key) else {
|
||||
return nil
|
||||
|
||||
@@ -654,12 +654,12 @@ extension CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 262)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var fileReadTooLarge: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 263)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var fileReadUnknownStringEncoding: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 264)
|
||||
}
|
||||
@@ -674,7 +674,7 @@ extension CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 514)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.7) @available(iOS, introduced: 5.0)
|
||||
@available(macOS, introduced: 10.7) @available(iOS, introduced: 5.0)
|
||||
public static var fileWriteFileExists: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 516)
|
||||
}
|
||||
@@ -689,17 +689,17 @@ extension CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 640)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
public static var fileWriteVolumeReadOnly: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 642)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, unavailable)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, unavailable)
|
||||
public static var fileManagerUnmountUnknown: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 768)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, unavailable)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, unavailable)
|
||||
public static var fileManagerUnmountBusy: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 769)
|
||||
}
|
||||
@@ -714,117 +714,117 @@ extension CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3072)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(macOS, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
public static var featureUnsupported: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3328)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var executableNotLoadable: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3584)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var executableArchitectureMismatch: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3585)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var executableRuntimeMismatch: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3586)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var executableLoad: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3587)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var executableLink: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3588)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
public static var propertyListReadCorrupt: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3840)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
public static var propertyListReadUnknownVersion: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3841)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
public static var propertyListReadStream: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3842)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
public static var propertyListWriteStream: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3851)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var propertyListWriteInvalid: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3852)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(macOS, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
public static var xpcConnectionInterrupted: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4097)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(macOS, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
public static var xpcConnectionInvalid: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4099)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(macOS, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
public static var xpcConnectionReplyInvalid: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4101)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(macOS, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
public static var ubiquitousFileUnavailable: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4353)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(macOS, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
public static var ubiquitousFileNotUploadedDueToQuota: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4354)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(macOS, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
public static var ubiquitousFileUbiquityServerNotAvailable: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4355)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var userActivityHandoffFailed: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4608)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var userActivityConnectionUnavailable: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4609)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var userActivityRemoteApplicationTimedOut: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4610)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var userActivityHandoffUserInfoTooLarge: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4611)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
public static var coderReadCorrupt: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4864)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
public static var coderValueNotFound: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4865)
|
||||
}
|
||||
@@ -872,13 +872,13 @@ extension CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 262)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "fileReadTooLarge")
|
||||
public static var fileReadTooLargeError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 263)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "fileReadUnknownStringEncoding")
|
||||
public static var fileReadUnknownStringEncodingError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 264)
|
||||
@@ -899,7 +899,7 @@ extension CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 514)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.7) @available(iOS, introduced: 5.0)
|
||||
@available(macOS, introduced: 10.7) @available(iOS, introduced: 5.0)
|
||||
@available(*, deprecated, renamed: "fileWriteFileExists")
|
||||
public static var fileWriteFileExistsError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 516)
|
||||
@@ -920,19 +920,19 @@ extension CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 640)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(*, deprecated, renamed: "fileWriteVolumeReadOnly")
|
||||
public static var fileWriteVolumeReadOnlyError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 642)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, unavailable)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, unavailable)
|
||||
@available(*, deprecated, renamed: "fileManagerUnmountUnknown")
|
||||
public static var fileManagerUnmountUnknownError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 768)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, unavailable)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, unavailable)
|
||||
@available(*, deprecated, renamed: "fileManagerUnmountBusy")
|
||||
public static var fileManagerUnmountBusyError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 769)
|
||||
@@ -953,115 +953,115 @@ extension CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3072)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(macOS, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(*, deprecated, renamed: "featureUnsupported")
|
||||
public static var featureUnsupportedError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3328)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "executableNotLoadable")
|
||||
public static var executableNotLoadableError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3584)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "executableArchitectureMismatch")
|
||||
public static var executableArchitectureMismatchError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3585)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "executableRuntimeMismatch")
|
||||
public static var executableRuntimeMismatchError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3586)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "executableLoad")
|
||||
public static var executableLoadError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3587)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "executableLink")
|
||||
public static var executableLinkError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3588)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(*, deprecated, renamed: "propertyListReadCorrupt")
|
||||
public static var propertyListReadCorruptError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3840)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(*, deprecated, renamed: "propertyListReadUnknownVersion")
|
||||
public static var propertyListReadUnknownVersionError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3841)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(*, deprecated, renamed: "propertyListReadStream")
|
||||
public static var propertyListReadStreamError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3842)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(*, deprecated, renamed: "propertyListWriteStream")
|
||||
public static var propertyListWriteStreamError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3851)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(*, deprecated, renamed: "propertyListWriteInvalid")
|
||||
public static var propertyListWriteInvalidError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3852)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(macOS, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(*, deprecated, renamed: "ubiquitousFileUnavailable")
|
||||
public static var ubiquitousFileUnavailableError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4353)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(macOS, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(*, deprecated, renamed: "ubiquitousFileNotUploadedDueToQuota")
|
||||
public static var ubiquitousFileNotUploadedDueToQuotaError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4354)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(*, deprecated, renamed: "userActivityHandoffFailed")
|
||||
public static var userActivityHandoffFailedError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4608)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(*, deprecated, renamed: "userActivityConnectionUnavailable")
|
||||
public static var userActivityConnectionUnavailableError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4609)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(*, deprecated, renamed: "userActivityRemoteApplicationTimedOut")
|
||||
public static var userActivityRemoteApplicationTimedOutError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4610)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(*, deprecated, renamed: "userActivityHandoffUserInfoTooLarge")
|
||||
public static var userActivityHandoffUserInfoTooLargeError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4611)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(*, deprecated, renamed: "coderReadCorrupt")
|
||||
public static var coderReadCorruptError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4864)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(*, deprecated, renamed: "coderValueNotFound")
|
||||
public static var coderValueNotFoundError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4865)
|
||||
@@ -1097,12 +1097,12 @@ extension CocoaError {
|
||||
return CocoaError.Code(rawValue: 262)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var fileReadTooLarge: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 263)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var fileReadUnknownStringEncoding: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 264)
|
||||
}
|
||||
@@ -1117,7 +1117,7 @@ extension CocoaError {
|
||||
return CocoaError.Code(rawValue: 514)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.7) @available(iOS, introduced: 5.0)
|
||||
@available(macOS, introduced: 10.7) @available(iOS, introduced: 5.0)
|
||||
public static var fileWriteFileExists: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 516)
|
||||
}
|
||||
@@ -1132,17 +1132,17 @@ extension CocoaError {
|
||||
return CocoaError.Code(rawValue: 640)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
public static var fileWriteVolumeReadOnly: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 642)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, unavailable)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, unavailable)
|
||||
public static var fileManagerUnmountUnknown: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 768)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, unavailable)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, unavailable)
|
||||
public static var fileManagerUnmountBusy: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 769)
|
||||
}
|
||||
@@ -1157,117 +1157,117 @@ extension CocoaError {
|
||||
return CocoaError.Code(rawValue: 3072)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(macOS, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
public static var featureUnsupported: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3328)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var executableNotLoadable: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3584)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var executableArchitectureMismatch: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3585)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var executableRuntimeMismatch: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3586)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var executableLoad: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3587)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var executableLink: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3588)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
public static var propertyListReadCorrupt: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3840)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
public static var propertyListReadUnknownVersion: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3841)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
public static var propertyListReadStream: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3842)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
public static var propertyListWriteStream: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3851)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var propertyListWriteInvalid: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3852)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(macOS, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
public static var xpcConnectionInterrupted: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4097)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(macOS, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
public static var xpcConnectionInvalid: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4099)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(macOS, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
public static var xpcConnectionReplyInvalid: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4101)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(macOS, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
public static var ubiquitousFileUnavailable: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4353)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(macOS, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
public static var ubiquitousFileNotUploadedDueToQuota: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4354)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(macOS, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
public static var ubiquitousFileUbiquityServerNotAvailable: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4355)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var userActivityHandoffFailed: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4608)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var userActivityConnectionUnavailable: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4609)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var userActivityRemoteApplicationTimedOut: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4610)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var userActivityHandoffUserInfoTooLarge: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4611)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
public static var coderReadCorrupt: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4864)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
public static var coderValueNotFound: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4865)
|
||||
}
|
||||
@@ -1315,13 +1315,13 @@ extension CocoaError {
|
||||
return CocoaError.Code(rawValue: 262)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "fileReadTooLarge")
|
||||
public static var fileReadTooLargeError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 263)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "fileReadUnknownStringEncoding")
|
||||
public static var fileReadUnknownStringEncodingError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 264)
|
||||
@@ -1342,7 +1342,7 @@ extension CocoaError {
|
||||
return CocoaError.Code(rawValue: 514)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.7) @available(iOS, introduced: 5.0)
|
||||
@available(macOS, introduced: 10.7) @available(iOS, introduced: 5.0)
|
||||
@available(*, deprecated, renamed: "fileWriteFileExists")
|
||||
public static var fileWriteFileExistsError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 516)
|
||||
@@ -1363,19 +1363,19 @@ extension CocoaError {
|
||||
return CocoaError.Code(rawValue: 640)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(*, deprecated, renamed: "fileWriteVolumeReadOnly")
|
||||
public static var fileWriteVolumeReadOnlyError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 642)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, unavailable)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, unavailable)
|
||||
@available(*, deprecated, renamed: "fileManagerUnmountUnknown")
|
||||
public static var fileManagerUnmountUnknownError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 768)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, unavailable)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, unavailable)
|
||||
@available(*, deprecated, renamed: "fileManagerUnmountBusy")
|
||||
public static var fileManagerUnmountBusyError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 769)
|
||||
@@ -1396,115 +1396,115 @@ extension CocoaError {
|
||||
return CocoaError.Code(rawValue: 3072)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(macOS, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(*, deprecated, renamed: "featureUnsupported")
|
||||
public static var featureUnsupportedError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3328)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "executableNotLoadable")
|
||||
public static var executableNotLoadableError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3584)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "executableArchitectureMismatch")
|
||||
public static var executableArchitectureMismatchError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3585)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "executableRuntimeMismatch")
|
||||
public static var executableRuntimeMismatchError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3586)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "executableLoad")
|
||||
public static var executableLoadError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3587)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(*, deprecated, renamed: "executableLink")
|
||||
public static var executableLinkError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3588)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(*, deprecated, renamed: "propertyListReadCorrupt")
|
||||
public static var propertyListReadCorruptError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3840)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(*, deprecated, renamed: "propertyListReadUnknownVersion")
|
||||
public static var propertyListReadUnknownVersionError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3841)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(*, deprecated, renamed: "propertyListReadStream")
|
||||
public static var propertyListReadStreamError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3842)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(*, deprecated, renamed: "propertyListWriteStream")
|
||||
public static var propertyListWriteStreamError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3851)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(*, deprecated, renamed: "propertyListWriteInvalid")
|
||||
public static var propertyListWriteInvalidError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 3852)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(macOS, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(*, deprecated, renamed: "ubiquitousFileUnavailable")
|
||||
public static var ubiquitousFileUnavailableError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4353)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(macOS, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(*, deprecated, renamed: "ubiquitousFileNotUploadedDueToQuota")
|
||||
public static var ubiquitousFileNotUploadedDueToQuotaError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4354)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(*, deprecated, renamed: "userActivityHandoffFailed")
|
||||
public static var userActivityHandoffFailedError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4608)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(*, deprecated, renamed: "userActivityConnectionUnavailable")
|
||||
public static var userActivityConnectionUnavailableError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4609)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(*, deprecated, renamed: "userActivityRemoteApplicationTimedOut")
|
||||
public static var userActivityRemoteApplicationTimedOutError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4610)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(*, deprecated, renamed: "userActivityHandoffUserInfoTooLarge")
|
||||
public static var userActivityHandoffUserInfoTooLargeError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4611)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(*, deprecated, renamed: "coderReadCorrupt")
|
||||
public static var coderReadCorruptError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4864)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(*, deprecated, renamed: "coderValueNotFound")
|
||||
public static var coderValueNotFoundError: CocoaError.Code {
|
||||
return CocoaError.Code(rawValue: 4865)
|
||||
@@ -1512,12 +1512,12 @@ extension CocoaError {
|
||||
}
|
||||
|
||||
extension CocoaError {
|
||||
@available(OSX, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
public var isCoderError: Bool {
|
||||
return code.rawValue >= 4864 && code.rawValue <= 4991
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public var isExecutableError: Bool {
|
||||
return code.rawValue >= 3584 && code.rawValue <= 3839
|
||||
}
|
||||
@@ -1530,17 +1530,17 @@ extension CocoaError {
|
||||
return code.rawValue >= 2048 && code.rawValue <= 2559
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
@available(macOS, introduced: 10.6) @available(iOS, introduced: 4.0)
|
||||
public var isPropertyListError: Bool {
|
||||
return code.rawValue >= 3840 && code.rawValue <= 4095
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
@available(macOS, introduced: 10.9) @available(iOS, introduced: 7.0)
|
||||
public var isUbiquitousFileError: Bool {
|
||||
return code.rawValue >= 4352 && code.rawValue <= 4607
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public var isUserActivityError: Bool {
|
||||
return code.rawValue >= 4608 && code.rawValue <= 4863
|
||||
}
|
||||
@@ -1549,7 +1549,7 @@ extension CocoaError {
|
||||
return code.rawValue >= 1024 && code.rawValue <= 2047
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
@available(macOS, introduced: 10.8) @available(iOS, introduced: 6.0)
|
||||
public var isXPCConnectionError: Bool {
|
||||
return code.rawValue >= 4096 && code.rawValue <= 4224
|
||||
}
|
||||
@@ -1880,7 +1880,7 @@ public extension URLError.Code {
|
||||
public static var cannotParseResponse: URLError.Code {
|
||||
return URLError.Code(rawValue: -1017)
|
||||
}
|
||||
@available(OSX, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
public static var appTransportSecurityRequiresSecureConnection: URLError.Code {
|
||||
return URLError.Code(rawValue: -1022)
|
||||
}
|
||||
@@ -1893,7 +1893,7 @@ public extension URLError.Code {
|
||||
public static var noPermissionsToReadFile: URLError.Code {
|
||||
return URLError.Code(rawValue: -1102)
|
||||
}
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var dataLengthExceedsMaximum: URLError.Code {
|
||||
return URLError.Code(rawValue: -1103)
|
||||
}
|
||||
@@ -1946,37 +1946,37 @@ public extension URLError.Code {
|
||||
return URLError.Code(rawValue: -3007)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
@available(macOS, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
public static var internationalRoamingOff: URLError.Code {
|
||||
return URLError.Code(rawValue: -1018)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
@available(macOS, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
public static var callIsActive: URLError.Code {
|
||||
return URLError.Code(rawValue: -1019)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
@available(macOS, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
public static var dataNotAllowed: URLError.Code {
|
||||
return URLError.Code(rawValue: -1020)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
@available(macOS, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
public static var requestBodyStreamExhausted: URLError.Code {
|
||||
return URLError.Code(rawValue: -1021)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var backgroundSessionRequiresSharedContainer: URLError.Code {
|
||||
return URLError.Code(rawValue: -995)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var backgroundSessionInUseByAnotherProcess: URLError.Code {
|
||||
return URLError.Code(rawValue: -996)
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var backgroundSessionWasDisconnected: URLError.Code {
|
||||
return URLError.Code(rawValue: -997)
|
||||
}
|
||||
@@ -2088,7 +2088,7 @@ public extension URLError {
|
||||
return .cannotParseResponse
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
@available(macOS, introduced: 10.11) @available(iOS, introduced: 9.0)
|
||||
public static var appTransportSecurityRequiresSecureConnection: URLError.Code {
|
||||
return .appTransportSecurityRequiresSecureConnection
|
||||
}
|
||||
@@ -2105,7 +2105,7 @@ public extension URLError {
|
||||
return .noPermissionsToReadFile
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
@available(macOS, introduced: 10.5) @available(iOS, introduced: 2.0)
|
||||
public static var dataLengthExceedsMaximum: URLError.Code {
|
||||
return .dataLengthExceedsMaximum
|
||||
}
|
||||
@@ -2174,37 +2174,37 @@ public extension URLError {
|
||||
return .downloadDecodingFailedToComplete
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
@available(macOS, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
public static var internationalRoamingOff: URLError.Code {
|
||||
return .internationalRoamingOff
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
@available(macOS, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
public static var callIsActive: URLError.Code {
|
||||
return .callIsActive
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
@available(macOS, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
public static var dataNotAllowed: URLError.Code {
|
||||
return .dataNotAllowed
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
@available(macOS, introduced: 10.7) @available(iOS, introduced: 3.0)
|
||||
public static var requestBodyStreamExhausted: URLError.Code {
|
||||
return .requestBodyStreamExhausted
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var backgroundSessionRequiresSharedContainer: Code {
|
||||
return .backgroundSessionRequiresSharedContainer
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var backgroundSessionInUseByAnotherProcess: Code {
|
||||
return .backgroundSessionInUseByAnotherProcess
|
||||
}
|
||||
|
||||
@available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
@available(macOS, introduced: 10.10) @available(iOS, introduced: 8.0)
|
||||
public static var backgroundSessionWasDisconnected: Code {
|
||||
return .backgroundSessionWasDisconnected
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
|
||||
@_exported import Foundation // Clang module
|
||||
|
||||
@available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
@available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
extension NSItemProvider {
|
||||
|
||||
@available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
@available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
public func registerObject<
|
||||
T : _ObjectiveCBridgeable
|
||||
> (
|
||||
@@ -33,7 +33,7 @@ extension NSItemProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
@available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
public func canLoadObject<
|
||||
T : _ObjectiveCBridgeable
|
||||
>(ofClass: T.Type) -> Bool
|
||||
@@ -41,7 +41,7 @@ extension NSItemProvider {
|
||||
return self.canLoadObject(ofClass: T._ObjectiveCType.self)
|
||||
}
|
||||
|
||||
@available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
@available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
public func loadObject<
|
||||
T : _ObjectiveCBridgeable
|
||||
>(
|
||||
|
||||
@@ -542,7 +542,7 @@ extension StringProtocol where Index == String.Index {
|
||||
|
||||
/// A capitalized representation of the string that is produced
|
||||
/// using the current locale.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var localizedCapitalized: String {
|
||||
return _ns.localizedCapitalized
|
||||
}
|
||||
@@ -888,7 +888,7 @@ extension StringProtocol where Index == String.Index {
|
||||
|
||||
/// A lowercase version of the string that is produced using the current
|
||||
/// locale.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var localizedLowercase: String {
|
||||
return _ns.localizedLowercase
|
||||
}
|
||||
@@ -953,7 +953,7 @@ extension StringProtocol where Index == String.Index {
|
||||
/// similar to how searches are done generally in the system. The search is
|
||||
/// locale-aware, case and diacritic insensitive. The exact list of search
|
||||
/// options applied may change over time.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public func localizedStandardContains<
|
||||
T : StringProtocol
|
||||
>(_ string: T) -> Bool {
|
||||
@@ -1128,7 +1128,7 @@ extension StringProtocol where Index == String.Index {
|
||||
|
||||
/// An uppercase version of the string that is produced using the current
|
||||
/// locale.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var localizedUppercase: String {
|
||||
return _ns.localizedUppercase as String
|
||||
}
|
||||
@@ -1185,7 +1185,7 @@ extension StringProtocol where Index == String.Index {
|
||||
|
||||
#if !DEPLOYMENT_RUNTIME_SWIFT
|
||||
/// Perform string transliteration.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public func applyingTransform(
|
||||
_ transform: StringTransform, reverse: Bool
|
||||
) -> String? {
|
||||
@@ -1604,7 +1604,7 @@ extension StringProtocol where Index == String.Index {
|
||||
/// similar to how searches are done generally in the system. The search is
|
||||
/// locale-aware, case and diacritic insensitive. The exact list of search
|
||||
/// options applied may change over time.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public func localizedStandardRange<
|
||||
T : StringProtocol
|
||||
>(of string: T) -> Range<Index>? {
|
||||
|
||||
@@ -19,7 +19,7 @@ extension UndoManager {
|
||||
fatalError("This API has been renamed")
|
||||
}
|
||||
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public func registerUndo<TargetType : AnyObject>(withTarget target: TargetType, handler: @escaping (TargetType) -> Void) {
|
||||
__NSUndoManagerRegisterWithTargetHandler( self, target) { internalTarget in
|
||||
handler(internalTarget as! TargetType)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
@_exported import Foundation // Clang module
|
||||
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public struct PersonNameComponents : ReferenceConvertible, Hashable, Equatable, _MutableBoxing {
|
||||
public typealias ReferenceType = NSPersonNameComponents
|
||||
internal var _handle: _MutableHandle<NSPersonNameComponents>
|
||||
@@ -75,14 +75,14 @@ public struct PersonNameComponents : ReferenceConvertible, Hashable, Equatable,
|
||||
return _handle.map { $0.hash }
|
||||
}
|
||||
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public static func ==(lhs : PersonNameComponents, rhs: PersonNameComponents) -> Bool {
|
||||
// Don't copy references here; no one should be storing anything
|
||||
return lhs._handle._uncopiedReference().isEqual(rhs._handle._uncopiedReference())
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
extension PersonNameComponents : CustomStringConvertible, CustomDebugStringConvertible, CustomReflectable {
|
||||
public var description: String {
|
||||
return self.customMirror.children.reduce("") {
|
||||
@@ -107,7 +107,7 @@ extension PersonNameComponents : CustomStringConvertible, CustomDebugStringConve
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
extension PersonNameComponents : _ObjectiveCBridgeable {
|
||||
public static func _getObjectiveCType() -> Any.Type {
|
||||
return NSPersonNameComponents.self
|
||||
@@ -136,7 +136,7 @@ extension PersonNameComponents : _ObjectiveCBridgeable {
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
extension NSPersonNameComponents : _HasCustomAnyHashableRepresentation {
|
||||
// Must be @nonobjc to avoid infinite recursion during bridging.
|
||||
@nonobjc
|
||||
@@ -145,7 +145,7 @@ extension NSPersonNameComponents : _HasCustomAnyHashableRepresentation {
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
extension PersonNameComponents : Codable {
|
||||
private enum CodingKeys : Int, CodingKey {
|
||||
case namePrefix
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
@_exported import Foundation // Clang module
|
||||
|
||||
public extension Progress {
|
||||
@available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
@available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
public var estimatedTimeRemaining: TimeInterval? {
|
||||
get {
|
||||
guard let v = self.__estimatedTimeRemaining else { return nil }
|
||||
@@ -29,7 +29,7 @@ public extension Progress {
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
@available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
public var throughput: Int? {
|
||||
get {
|
||||
guard let v = self.__throughput else { return nil }
|
||||
@@ -45,7 +45,7 @@ public extension Progress {
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
@available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
public var fileTotalCount: Int? {
|
||||
get {
|
||||
guard let v = self.__fileTotalCount else { return nil }
|
||||
@@ -61,7 +61,7 @@ public extension Progress {
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
@available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
|
||||
public var fileCompletedCount: Int? {
|
||||
get {
|
||||
guard let v = self.__fileCompletedCount else { return nil }
|
||||
|
||||
@@ -121,12 +121,12 @@ public struct URLResourceValues {
|
||||
}
|
||||
|
||||
/// True if resource is an application.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var isApplication: Bool? { return _get(.isApplicationKey) }
|
||||
|
||||
#if os(macOS)
|
||||
/// True if the resource is scriptable. Only applies to applications.
|
||||
@available(OSX 10.11, *)
|
||||
@available(macOS 10.11, *)
|
||||
public var applicationIsScriptable: Bool? { return _get(.applicationIsScriptableKey) }
|
||||
#endif
|
||||
|
||||
@@ -245,7 +245,7 @@ public struct URLResourceValues {
|
||||
public var path: String? { return _get(.pathKey) }
|
||||
|
||||
/// The URL's path as a canonical absolute file system path.
|
||||
@available(OSX 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
public var canonicalPath: String? { return _get(.canonicalPathKey) }
|
||||
|
||||
/// True if this URL is a file system trigger directory. Traversing or opening a file system trigger will cause an attempt to mount a file system on the trigger directory.
|
||||
@@ -254,22 +254,22 @@ public struct URLResourceValues {
|
||||
/// An opaque generation identifier which can be compared using `==` to determine if the data in a document has been modified.
|
||||
///
|
||||
/// For URLs which refer to the same file inode, the generation identifier will change when the data in the file's data fork is changed (changes to extended attributes or other file system metadata do not change the generation identifier). For URLs which refer to the same directory inode, the generation identifier will change when direct children of that directory are added, removed or renamed (changes to the data of the direct children of that directory will not change the generation identifier). The generation identifier is persistent across system restarts. The generation identifier is tied to a specific document on a specific volume and is not transferred when the document is copied to another volume. This property is not supported by all volumes.
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
public var generationIdentifier: (NSCopying & NSCoding & NSSecureCoding & NSObjectProtocol)? { return _get(.generationIdentifierKey) }
|
||||
|
||||
/// The document identifier -- a value assigned by the kernel to a document (which can be either a file or directory) and is used to identify the document regardless of where it gets moved on a volume.
|
||||
///
|
||||
/// The document identifier survives "safe save" operations; i.e it is sticky to the path it was assigned to (`replaceItem(at:,withItemAt:,backupItemName:,options:,resultingItem:) throws` is the preferred safe-save API). The document identifier is persistent across system restarts. The document identifier is not transferred when the file is copied. Document identifiers are only unique within a single volume. This property is not supported by all volumes.
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
public var documentIdentifier: Int? { return _get(.documentIdentifierKey) }
|
||||
|
||||
/// The date the resource was created, or renamed into or within its parent directory. Note that inconsistent behavior may be observed when this attribute is requested on hard-linked items. This property is not supported by all volumes.
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
public var addedToDirectoryDate: Date? { return _get(.addedToDirectoryDateKey) }
|
||||
|
||||
#if os(macOS)
|
||||
/// The quarantine properties as defined in LSQuarantine.h. To remove quarantine information from a file, pass `nil` as the value when setting this property.
|
||||
@available(OSX 10.10, *)
|
||||
@available(macOS 10.10, *)
|
||||
public var quarantineProperties: [String : Any]? {
|
||||
get {
|
||||
let value = _values[.quarantinePropertiesKey]
|
||||
@@ -304,12 +304,12 @@ public struct URLResourceValues {
|
||||
/// Total available capacity in bytes for "Important" resources, including space expected to be cleared by purging non-essential and cached resources. "Important" means something that the user or application clearly expects to be present on the local system, but is ultimately replaceable. This would include items that the user has explicitly requested via the UI, and resources that an application requires in order to provide functionality.
|
||||
/// Examples: A video that the user has explicitly requested to watch but has not yet finished watching or an audio file that the user has requested to download.
|
||||
/// This value should not be used in determining if there is room for an irreplaceable resource. In the case of irreplaceable resources, always attempt to save the resource regardless of available capacity and handle failure as gracefully as possible.
|
||||
@available(OSX 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
@available(macOS 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
public var volumeAvailableCapacityForImportantUsage: Int64? { return _get(.volumeAvailableCapacityForImportantUsageKey) }
|
||||
|
||||
/// Total available capacity in bytes for "Opportunistic" resources, including space expected to be cleared by purging non-essential and cached resources. "Opportunistic" means something that the user is likely to want but does not expect to be present on the local system, but is ultimately non-essential and replaceable. This would include items that will be created or downloaded without an explicit request from the user on the current device.
|
||||
/// Examples: A background download of a newly available episode of a TV series that a user has been recently watching, a piece of content explicitly requested on another device, and a new document saved to a network server by the current user from another device.
|
||||
@available(OSX 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
@available(macOS 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
public var volumeAvailableCapacityForOpportunisticUsage: Int64? { return _get(.volumeAvailableCapacityForOpportunisticUsageKey) }
|
||||
#endif
|
||||
|
||||
@@ -401,15 +401,15 @@ public struct URLResourceValues {
|
||||
public var volumeLocalizedName : String? { return _get(.volumeLocalizedNameKey) }
|
||||
|
||||
/// true if the volume is encrypted.
|
||||
@available(OSX 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
public var volumeIsEncrypted : Bool? { return _get(.volumeIsEncryptedKey) }
|
||||
|
||||
/// true if the volume is the root filesystem.
|
||||
@available(OSX 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
public var volumeIsRootFileSystem : Bool? { return _get(.volumeIsRootFileSystemKey) }
|
||||
|
||||
/// true if the volume supports transparent decompression of compressed files using decmpfs.
|
||||
@available(OSX 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
|
||||
public var volumeSupportsCompression : Bool? { return _get(.volumeSupportsCompressionKey) }
|
||||
|
||||
/// true if this item is synced to the cloud, false if it is only a local file.
|
||||
@@ -437,32 +437,32 @@ public struct URLResourceValues {
|
||||
public var ubiquitousItemUploadingError : NSError? { return _get(.ubiquitousItemUploadingErrorKey) }
|
||||
|
||||
/// returns whether a download of this item has already been requested with an API like `startDownloadingUbiquitousItem(at:) throws`.
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
public var ubiquitousItemDownloadRequested : Bool? { return _get(.ubiquitousItemDownloadRequestedKey) }
|
||||
|
||||
/// returns the name of this item's container as displayed to users.
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
public var ubiquitousItemContainerDisplayName : String? { return _get(.ubiquitousItemContainerDisplayNameKey) }
|
||||
|
||||
#if os(macOS) || os(iOS)
|
||||
// true if ubiquitous item is shared.
|
||||
@available(OSX 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
@available(macOS 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
public var ubiquitousItemIsShared: Bool? { return _get(.ubiquitousItemIsSharedKey) }
|
||||
|
||||
// The current user's role for this shared item, or nil if not shared
|
||||
@available(OSX 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
@available(macOS 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
public var ubiquitousSharedItemCurrentUserRole: URLUbiquitousSharedItemRole? { return _get(.ubiquitousSharedItemCurrentUserRoleKey) }
|
||||
|
||||
// The permissions for the current user, or nil if not shared.
|
||||
@available(OSX 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
@available(macOS 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
public var ubiquitousSharedItemCurrentUserPermissions: URLUbiquitousSharedItemPermissions? { return _get(.ubiquitousSharedItemCurrentUserPermissionsKey) }
|
||||
|
||||
// The name components for the owner, or nil if not shared.
|
||||
@available(OSX 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
@available(macOS 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
public var ubiquitousSharedItemOwnerNameComponents: PersonNameComponents? { return _get(.ubiquitousSharedItemOwnerNameComponentsKey) }
|
||||
|
||||
// The name components for the most recent editor, or nil if not shared.
|
||||
@available(OSX 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
@available(macOS 10.13, iOS 11.0, *) @available(tvOS, unavailable) @available(watchOS, unavailable)
|
||||
public var ubiquitousSharedItemMostRecentEditorNameComponents: PersonNameComponents? { return _get(.ubiquitousSharedItemMostRecentEditorNameComponentsKey) }
|
||||
#endif
|
||||
|
||||
@@ -543,7 +543,7 @@ public struct URL : ReferenceConvertible, Equatable {
|
||||
///
|
||||
/// If an empty string is used for the path, then the path is assumed to be ".".
|
||||
/// - note: This function avoids an extra file system access to check if the file URL is a directory. You should use it if you know the answer already.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public init(fileURLWithPath path: String, isDirectory: Bool, relativeTo base: URL?) {
|
||||
_url = URL._converted(from: NSURL(fileURLWithPath: path.isEmpty ? "." : path, isDirectory: isDirectory, relativeTo: base))
|
||||
}
|
||||
@@ -551,7 +551,7 @@ public struct URL : ReferenceConvertible, Equatable {
|
||||
/// Initializes a newly created file URL referencing the local file or directory at path, relative to a base URL.
|
||||
///
|
||||
/// If an empty string is used for the path, then the path is assumed to be ".".
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public init(fileURLWithPath path: String, relativeTo base: URL?) {
|
||||
_url = URL._converted(from: NSURL(fileURLWithPath: path.isEmpty ? "." : path, relativeTo: base))
|
||||
}
|
||||
@@ -574,7 +574,7 @@ public struct URL : ReferenceConvertible, Equatable {
|
||||
/// Initializes a newly created URL using the contents of the given data, relative to a base URL.
|
||||
///
|
||||
/// If the data representation is not a legal URL string as ASCII bytes, the URL object may not behave as expected. If the URL cannot be formed then this will return nil.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public init?(dataRepresentation: Data, relativeTo url: URL?, isAbsolute: Bool = false) {
|
||||
guard dataRepresentation.count > 0 else { return nil }
|
||||
|
||||
@@ -593,7 +593,7 @@ public struct URL : ReferenceConvertible, Equatable {
|
||||
}
|
||||
|
||||
/// Creates and initializes an NSURL that refers to the location specified by resolving the alias file at url. If the url argument does not refer to an alias file as defined by the NSURLIsAliasFileKey property, the NSURL returned is the same as url argument. This method fails and returns nil if the url argument is unreachable, or if the original file or directory could not be located or is not reachable, or if the original file or directory is on a volume that could not be located or mounted. The URLBookmarkResolutionWithSecurityScope option is not supported by this method.
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
public init(resolvingAliasFileAt url: URL, options: BookmarkResolutionOptions = []) throws {
|
||||
self.init(reference: try NSURL(resolvingAliasFileAt: url, options: options))
|
||||
}
|
||||
@@ -612,7 +612,7 @@ public struct URL : ReferenceConvertible, Equatable {
|
||||
/// Returns the data representation of the URL's relativeString.
|
||||
///
|
||||
/// If the URL was initialized with `init?(dataRepresentation:relativeTo:isAbsolute:)`, the data representation returned are the same bytes as those used at initialization; otherwise, the data representation returned are the bytes of the `relativeString` encoded with UTF8 string encoding.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var dataRepresentation: Data {
|
||||
return _url.dataRepresentation
|
||||
}
|
||||
@@ -765,7 +765,7 @@ public struct URL : ReferenceConvertible, Equatable {
|
||||
}
|
||||
|
||||
/// Returns true if the URL path represents a directory.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var hasDirectoryPath: Bool {
|
||||
return _url.hasDirectoryPath
|
||||
}
|
||||
@@ -774,7 +774,7 @@ public struct URL : ReferenceConvertible, Equatable {
|
||||
///
|
||||
/// File system representation is a null-terminated C string with canonical UTF-8 encoding.
|
||||
/// - note: The pointer is not valid outside the context of the block.
|
||||
@available(OSX 10.9, iOS 7.0, *)
|
||||
@available(macOS 10.9, iOS 7.0, *)
|
||||
public func withUnsafeFileSystemRepresentation<ResultType>(_ block: (UnsafePointer<Int8>?) throws -> ResultType) rethrows -> ResultType {
|
||||
return try block(_url.fileSystemRepresentation)
|
||||
}
|
||||
@@ -1008,7 +1008,7 @@ public struct URL : ReferenceConvertible, Equatable {
|
||||
/// Returns whether the promised item URL's resource exists and is reachable.
|
||||
///
|
||||
/// This method synchronously checks if the resource's backing store is reachable. Checking reachability is appropriate when making decisions that do not require other immediate operations on the resource, e.g. periodic maintenance of UI state that depends on the existence of a specific document. When performing operations such as opening a file or copying resource properties, it is more efficient to simply try the operation and handle failures. This method is currently applicable only to URLs for file system resources. For other URL types, `false` is returned.
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
public func checkPromisedItemIsReachable() throws -> Bool {
|
||||
var error : NSError?
|
||||
let result = _url.checkPromisedItemIsReachableAndReturnError(&error)
|
||||
@@ -1076,7 +1076,7 @@ public struct URL : ReferenceConvertible, Equatable {
|
||||
/// You are inside the accessor block of a coordinated read or write that used NSFileCoordinatorReadingImmediatelyAvailableMetadataOnly, NSFileCoordinatorWritingForDeleting, NSFileCoordinatorWritingForMoving, or NSFileCoordinatorWritingContentIndependentMetadataOnly
|
||||
///
|
||||
/// Most of the URL resource value keys will work with these APIs. However, there are some that are tied to the item's contents that will not work, such as `contentAccessDateKey` or `generationIdentifierKey`. If one of these keys is used, the method will return a `URLResourceValues` value, but the value for that property will be nil.
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
public func promisedItemResourceValues(forKeys keys: Set<URLResourceKey>) throws -> URLResourceValues {
|
||||
return URLResourceValues(keys: keys, values: try _url.promisedItemResourceValues(forKeys: Array(keys)))
|
||||
}
|
||||
@@ -1122,13 +1122,13 @@ public struct URL : ReferenceConvertible, Equatable {
|
||||
}
|
||||
|
||||
/// Given an NSURL created by resolving a bookmark data created with security scope, make the resource referenced by the url accessible to the process. When access to this resource is no longer needed the client must call stopAccessingSecurityScopedResource. Each call to startAccessingSecurityScopedResource must be balanced with a call to stopAccessingSecurityScopedResource (Note: this is not reference counted).
|
||||
@available(OSX 10.7, iOS 8.0, *)
|
||||
@available(macOS 10.7, iOS 8.0, *)
|
||||
public func startAccessingSecurityScopedResource() -> Bool {
|
||||
return _url.startAccessingSecurityScopedResource()
|
||||
}
|
||||
|
||||
/// Revokes the access granted to the url by a prior successful call to startAccessingSecurityScopedResource.
|
||||
@available(OSX 10.7, iOS 8.0, *)
|
||||
@available(macOS 10.7, iOS 8.0, *)
|
||||
public func stopAccessingSecurityScopedResource() {
|
||||
_url.stopAccessingSecurityScopedResource()
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, Equatable, _Mutabl
|
||||
}
|
||||
|
||||
// Returns a URL string created from the NSURLComponents. If the NSURLComponents has an authority component (user, password, host or port) and a path component, then the path must either begin with "/" or be an empty string. If the NSURLComponents does not have an authority component (user, password, host or port) and has a path component, the path component must not start with "//". If those requirements are not met, nil is returned.
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
public var string: String? {
|
||||
return _handle.map { $0.string }
|
||||
}
|
||||
@@ -190,7 +190,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, Equatable, _Mutabl
|
||||
set { _applyMutation { $0.percentEncodedFragment = newValue } }
|
||||
}
|
||||
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
private func _toStringRange(_ r : NSRange) -> Range<String.Index>? {
|
||||
guard r.location != NSNotFound else { return nil }
|
||||
|
||||
@@ -208,7 +208,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, Equatable, _Mutabl
|
||||
///
|
||||
/// If the component does not exist, nil is returned.
|
||||
/// - note: Zero length components are legal. For example, the URL string "scheme://:@/?#" has a zero length user, password, host, query and fragment; the URL strings "scheme:" and "" both have a zero length path.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var rangeOfScheme: Range<String.Index>? {
|
||||
return _toStringRange(_handle.map { $0.rangeOfScheme })
|
||||
}
|
||||
@@ -217,7 +217,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, Equatable, _Mutabl
|
||||
///
|
||||
/// If the component does not exist, nil is returned.
|
||||
/// - note: Zero length components are legal. For example, the URL string "scheme://:@/?#" has a zero length user, password, host, query and fragment; the URL strings "scheme:" and "" both have a zero length path.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var rangeOfUser: Range<String.Index>? {
|
||||
return _toStringRange(_handle.map { $0.rangeOfUser })
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, Equatable, _Mutabl
|
||||
///
|
||||
/// If the component does not exist, nil is returned.
|
||||
/// - note: Zero length components are legal. For example, the URL string "scheme://:@/?#" has a zero length user, password, host, query and fragment; the URL strings "scheme:" and "" both have a zero length path.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var rangeOfPassword: Range<String.Index>? {
|
||||
return _toStringRange(_handle.map { $0.rangeOfPassword })
|
||||
}
|
||||
@@ -235,7 +235,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, Equatable, _Mutabl
|
||||
///
|
||||
/// If the component does not exist, nil is returned.
|
||||
/// - note: Zero length components are legal. For example, the URL string "scheme://:@/?#" has a zero length user, password, host, query and fragment; the URL strings "scheme:" and "" both have a zero length path.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var rangeOfHost: Range<String.Index>? {
|
||||
return _toStringRange(_handle.map { $0.rangeOfHost })
|
||||
}
|
||||
@@ -244,7 +244,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, Equatable, _Mutabl
|
||||
///
|
||||
/// If the component does not exist, nil is returned.
|
||||
/// - note: Zero length components are legal. For example, the URL string "scheme://:@/?#" has a zero length user, password, host, query and fragment; the URL strings "scheme:" and "" both have a zero length path.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var rangeOfPort: Range<String.Index>? {
|
||||
return _toStringRange(_handle.map { $0.rangeOfPort })
|
||||
}
|
||||
@@ -253,7 +253,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, Equatable, _Mutabl
|
||||
///
|
||||
/// If the component does not exist, nil is returned.
|
||||
/// - note: Zero length components are legal. For example, the URL string "scheme://:@/?#" has a zero length user, password, host, query and fragment; the URL strings "scheme:" and "" both have a zero length path.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var rangeOfPath: Range<String.Index>? {
|
||||
return _toStringRange(_handle.map { $0.rangeOfPath })
|
||||
}
|
||||
@@ -262,7 +262,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, Equatable, _Mutabl
|
||||
///
|
||||
/// If the component does not exist, nil is returned.
|
||||
/// - note: Zero length components are legal. For example, the URL string "scheme://:@/?#" has a zero length user, password, host, query and fragment; the URL strings "scheme:" and "" both have a zero length path.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var rangeOfQuery: Range<String.Index>? {
|
||||
return _toStringRange(_handle.map { $0.rangeOfQuery })
|
||||
}
|
||||
@@ -271,7 +271,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, Equatable, _Mutabl
|
||||
///
|
||||
/// If the component does not exist, nil is returned.
|
||||
/// - note: Zero length components are legal. For example, the URL string "scheme://:@/?#" has a zero length user, password, host, query and fragment; the URL strings "scheme:" and "" both have a zero length path.
|
||||
@available(OSX 10.11, iOS 9.0, *)
|
||||
@available(macOS 10.11, iOS 9.0, *)
|
||||
public var rangeOfFragment: Range<String.Index>? {
|
||||
return _toStringRange(_handle.map { $0.rangeOfFragment })
|
||||
}
|
||||
@@ -285,7 +285,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, Equatable, _Mutabl
|
||||
/// The setter combines an array containing any number of `URLQueryItem`s, each of which represents a single key-value pair, into a query string and sets the `URLComponents` query property. Passing an empty array sets the query component of the `URLComponents` to an empty string. Passing nil removes the query component of the `URLComponents`.
|
||||
///
|
||||
/// - note: If a name-value pair in a query is empty (i.e. the query string starts with '&', ends with '&', or has "&&" within it), you get a `URLQueryItem` with a zero-length name and a nil value. If a query's name-value pair has nothing before the equals sign, you get a zero-length name. If a query's name-value pair has nothing after the equals sign, you get a zero-length value. If a query's name-value pair has no equals sign, the query name-value pair string is the name and you get a nil value.
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
public var queryItems: [URLQueryItem]? {
|
||||
get { return _handle.map { $0.queryItems } }
|
||||
set { _applyMutation { $0.queryItems = newValue } }
|
||||
@@ -379,7 +379,7 @@ extension NSURLComponents : _HasCustomAnyHashableRepresentation {
|
||||
|
||||
|
||||
/// A single name-value pair, for use with `URLComponents`.
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
public struct URLQueryItem : ReferenceConvertible, Hashable, Equatable {
|
||||
public typealias ReferenceType = NSURLQueryItem
|
||||
|
||||
@@ -404,13 +404,13 @@ public struct URLQueryItem : ReferenceConvertible, Hashable, Equatable {
|
||||
|
||||
public var hashValue: Int { return _queryItem.hash }
|
||||
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
public static func ==(lhs: URLQueryItem, rhs: URLQueryItem) -> Bool {
|
||||
return lhs._queryItem.isEqual(rhs as NSURLQueryItem)
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
extension URLQueryItem : CustomStringConvertible, CustomDebugStringConvertible, CustomReflectable {
|
||||
|
||||
public var description: String {
|
||||
@@ -434,7 +434,7 @@ extension URLQueryItem : CustomStringConvertible, CustomDebugStringConvertible,
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
extension URLQueryItem : _ObjectiveCBridgeable {
|
||||
public static func _getObjectiveCType() -> Any.Type {
|
||||
return NSURLQueryItem.self
|
||||
@@ -463,7 +463,7 @@ extension URLQueryItem : _ObjectiveCBridgeable {
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.10, iOS 8.0, *)
|
||||
@available(macOS 10.10, iOS 8.0, *)
|
||||
extension NSURLQueryItem : _HasCustomAnyHashableRepresentation {
|
||||
// Must be @nonobjc to avoid infinite recursion during bridging.
|
||||
@nonobjc
|
||||
|
||||
@@ -100,7 +100,7 @@ public struct URLRequest : ReferenceConvertible, Equatable, Hashable {
|
||||
/// The URLRequest.NetworkServiceType associated with this request.
|
||||
/// - discussion: This will return URLRequest.NetworkServiceType.default for requests that have
|
||||
/// not explicitly set a networkServiceType
|
||||
@available(OSX 10.7, iOS 4.0, *)
|
||||
@available(macOS 10.7, iOS 4.0, *)
|
||||
public var networkServiceType: NetworkServiceType {
|
||||
get {
|
||||
return _handle.map { $0.networkServiceType }
|
||||
@@ -112,7 +112,7 @@ public struct URLRequest : ReferenceConvertible, Equatable, Hashable {
|
||||
|
||||
/// `true` if the receiver is allowed to use the built in cellular radios to
|
||||
/// satisfy the request, `false` otherwise.
|
||||
@available(OSX 10.8, iOS 6.0, *)
|
||||
@available(macOS 10.8, iOS 6.0, *)
|
||||
public var allowsCellularAccess: Bool {
|
||||
get {
|
||||
return _handle.map { $0.allowsCellularAccess }
|
||||
@@ -219,7 +219,7 @@ public struct URLRequest : ReferenceConvertible, Equatable, Hashable {
|
||||
/// `true` if the receiver should transmit before the previous response
|
||||
/// is received. `false` if the receiver should wait for the previous response
|
||||
/// before transmitting.
|
||||
@available(OSX 10.7, iOS 4.0, *)
|
||||
@available(macOS 10.7, iOS 4.0, *)
|
||||
public var httpShouldUsePipelining: Bool {
|
||||
get {
|
||||
return _handle.map { $0.httpShouldUsePipelining }
|
||||
|
||||
@@ -15,7 +15,7 @@ import Darwin.uuid
|
||||
import _SwiftCoreFoundationOverlayShims
|
||||
|
||||
/// Represents UUID strings, which can be used to uniquely identify types, interfaces, and other items.
|
||||
@available(OSX 10.8, iOS 6.0, *)
|
||||
@available(macOS 10.8, iOS 6.0, *)
|
||||
public struct UUID : ReferenceConvertible, Hashable, Equatable, CustomStringConvertible {
|
||||
public typealias ReferenceType = NSUUID
|
||||
|
||||
|
||||
Reference in New Issue
Block a user