Skip to content

Commit 8f7375b

Browse files
committed
[gardening] Prefer macOS over OSX for @available
1 parent 397eaed commit 8f7375b

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

Foundation/JSONEncoder.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ open class JSONEncoder {
3434
public static let prettyPrinted = OutputFormatting(rawValue: 1 << 0)
3535

3636
/// Produce JSON with dictionary keys sorted in lexicographic order.
37-
@available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
37+
@available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *)
3838
public static let sortedKeys = OutputFormatting(rawValue: 1 << 1)
3939
}
4040

@@ -50,7 +50,7 @@ open class JSONEncoder {
5050
case millisecondsSince1970
5151

5252
/// Encode the `Date` as an ISO-8601-formatted string (in RFC 3339 format).
53-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
53+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
5454
case iso8601
5555

5656
/// Encode the `Date` as a string formatted by the given formatter.
@@ -822,7 +822,7 @@ open class JSONDecoder {
822822
case millisecondsSince1970
823823

824824
/// Decode the `Date` as an ISO-8601-formatted string (in RFC 3339 format).
825-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
825+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
826826
case iso8601
827827

828828
/// Decode the `Date` as a string parsed by the given formatter.
@@ -2151,7 +2151,7 @@ fileprivate struct _JSONKey : CodingKey {
21512151
//===----------------------------------------------------------------------===//
21522152

21532153
// 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.
2154-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
2154+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
21552155
fileprivate var _iso8601Formatter: ISO8601DateFormatter = {
21562156
let formatter = ISO8601DateFormatter()
21572157
formatter.formatOptions = .withInternetDateTime

Foundation/Measurement.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import _SwiftCoreFoundationOverlayShims
2020
/// A `Measurement` is a model type that holds a `Double` value associated with a `Unit`.
2121
///
2222
/// Measurements support a large set of operators, including `+`, `-`, `*`, `/`, and a full set of comparison operators.
23-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
23+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
2424
public struct Measurement<UnitType : Unit> : ReferenceConvertible, Comparable, Equatable {
2525
public typealias ReferenceType = NSMeasurement
2626

@@ -41,7 +41,7 @@ public struct Measurement<UnitType : Unit> : ReferenceConvertible, Comparable, E
4141
}
4242
}
4343

44-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
44+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
4545
extension Measurement : CustomStringConvertible, CustomDebugStringConvertible, CustomReflectable {
4646
public var description: String {
4747
return "\(value) \(unit.symbol)"
@@ -61,7 +61,7 @@ extension Measurement : CustomStringConvertible, CustomDebugStringConvertible, C
6161

6262

6363
/// When a `Measurement` contains a `Dimension` unit, it gains the ability to convert between the kinds of units in that dimension.
64-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
64+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
6565
extension Measurement where UnitType : Dimension {
6666
/// Returns a new measurement created by converting to the specified unit.
6767
///
@@ -117,7 +117,7 @@ extension Measurement where UnitType : Dimension {
117117
}
118118
}
119119

120-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
120+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
121121
extension Measurement {
122122
/// Add two measurements of the same Unit.
123123
/// - precondition: The `unit` of `lhs` and `rhs` must be `isEqual`.
@@ -212,7 +212,7 @@ internal typealias MeasurementBridgeType = _ObjectTypeBridgeable
212212
internal typealias MeasurementBridgeType = _ObjectiveCBridgeable
213213
#endif
214214

215-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
215+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
216216
extension Measurement : MeasurementBridgeType {
217217
@_semantics("convertToObjectiveC")
218218
public func _bridgeToObjectiveC() -> NSMeasurement {
@@ -238,7 +238,7 @@ extension Measurement : MeasurementBridgeType {
238238
}
239239
}
240240

241-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
241+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
242242
extension NSMeasurement : _HasCustomAnyHashableRepresentation {
243243
// Must be @nonobjc to avoid infinite recursion during bridging.
244244
@nonobjc
@@ -252,7 +252,7 @@ extension NSMeasurement : _HasCustomAnyHashableRepresentation {
252252
}
253253

254254
// This workaround is required for the time being, because Swift doesn't support covariance for Measurement (26607639)
255-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
255+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
256256
extension MeasurementFormatter {
257257
public func string<UnitType>(from measurement: Measurement<UnitType>) -> String {
258258
if let result = string(for: measurement) {
@@ -263,7 +263,7 @@ extension MeasurementFormatter {
263263
}
264264
}
265265

266-
// @available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
266+
// @available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
267267
// extension Unit : Codable {
268268
// public convenience init(from decoder: Decoder) throws {
269269
// let container = try decoder.singleValueContainer()
@@ -277,7 +277,7 @@ extension MeasurementFormatter {
277277
// }
278278
// }
279279

280-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
280+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
281281
extension Measurement : Codable {
282282
private enum CodingKeys : Int, CodingKey {
283283
case value

Foundation/NSStringAPI.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ extension StringProtocol where Index == String.Index {
542542

543543
/// A capitalized representation of the string that is produced
544544
/// using the current locale.
545-
@available(OSX 10.11, iOS 9.0, *)
545+
@available(macOS 10.11, iOS 9.0, *)
546546
public var localizedCapitalized: String {
547547
return _ns.localizedCapitalized
548548
}
@@ -888,7 +888,7 @@ extension StringProtocol where Index == String.Index {
888888

889889
/// A lowercase version of the string that is produced using the current
890890
/// locale.
891-
@available(OSX 10.11, iOS 9.0, *)
891+
@available(macOS 10.11, iOS 9.0, *)
892892
public var localizedLowercase: String {
893893
return _ns.localizedLowercase
894894
}
@@ -953,7 +953,7 @@ extension StringProtocol where Index == String.Index {
953953
/// similar to how searches are done generally in the system. The search is
954954
/// locale-aware, case and diacritic insensitive. The exact list of search
955955
/// options applied may change over time.
956-
@available(OSX 10.11, iOS 9.0, *)
956+
@available(macOS 10.11, iOS 9.0, *)
957957
public func localizedStandardContains<
958958
T : StringProtocol
959959
>(_ string: T) -> Bool {
@@ -1128,7 +1128,7 @@ extension StringProtocol where Index == String.Index {
11281128

11291129
/// An uppercase version of the string that is produced using the current
11301130
/// locale.
1131-
@available(OSX 10.11, iOS 9.0, *)
1131+
@available(macOS 10.11, iOS 9.0, *)
11321132
public var localizedUppercase: String {
11331133
return _ns.localizedUppercase as String
11341134
}
@@ -1185,7 +1185,7 @@ extension StringProtocol where Index == String.Index {
11851185

11861186
#if !DEPLOYMENT_RUNTIME_SWIFT
11871187
/// Perform string transliteration.
1188-
@available(OSX 10.11, iOS 9.0, *)
1188+
@available(macOS 10.11, iOS 9.0, *)
11891189
public func applyingTransform(
11901190
_ transform: StringTransform, reverse: Bool
11911191
) -> String? {
@@ -1604,7 +1604,7 @@ extension StringProtocol where Index == String.Index {
16041604
/// similar to how searches are done generally in the system. The search is
16051605
/// locale-aware, case and diacritic insensitive. The exact list of search
16061606
/// options applied may change over time.
1607-
@available(OSX 10.11, iOS 9.0, *)
1607+
@available(macOS 10.11, iOS 9.0, *)
16081608
public func localizedStandardRange<
16091609
T : StringProtocol
16101610
>(of string: T) -> Range<Index>? {

0 commit comments

Comments
 (0)