Skip to content

Commit d27190b

Browse files
authored
Merge pull request #25454 from lorentey/nsvalue-availability
[Foundation] Set correct availability on NSValue.value(of:)
2 parents eacd5e9 + dd29a80 commit d27190b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Darwin/Foundation-swiftoverlay/NSValue.swift.gyb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ${ ObjectiveCBridgeableImplementationForNSValue("CGSize") }
2424
${ ObjectiveCBridgeableImplementationForNSValue("CGAffineTransform") }
2525

2626
extension NSValue {
27-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
27+
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
2828
public func value<StoredType>(of type: StoredType.Type) -> StoredType? {
2929
if StoredType.self is AnyObject.Type {
3030
let encoding = String(cString: objCType)
@@ -42,11 +42,7 @@ extension NSValue {
4242
}
4343
let allocated = UnsafeMutablePointer<StoredType>.allocate(capacity: 1)
4444
defer { allocated.deallocate() }
45-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
46-
getValue(allocated, size: storedSize)
47-
} else {
48-
getValue(allocated)
49-
}
45+
getValue(allocated, size: storedSize)
5046
return allocated.pointee
5147
}
5248
return nil

0 commit comments

Comments
 (0)