Skip to content

Commit 20bdedf

Browse files
authored
Merge pull request #6689 from parkera/pr27556178_wrong_image_thumbnail_key
Use the right key for the image thumbnail dictionaries in the URL resources struct
2 parents 6b3f23c + d34d36e commit 20bdedf

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

stdlib/public/SDK/AppKit/AppKit_FoundationExtensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ public extension URLResourceValues {
7575

7676
/// Returns a dictionary of NSImage objects keyed by size.
7777
@available(OSX 10.10, *)
78-
public var thumbnailDictionary : [URLThumbnailSizeKey : NSImage]? {
79-
return allValues[URLResourceKey.thumbnailDictionaryKey] as? [URLThumbnailSizeKey : NSImage]
78+
public var thumbnailDictionary : [URLThumbnailDictionaryItem : NSImage]? {
79+
return allValues[URLResourceKey.thumbnailDictionaryKey] as? [URLThumbnailDictionaryItem : NSImage]
8080
}
8181

8282
}

stdlib/public/SDK/Foundation/URL.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,6 @@
1212

1313
@_exported import Foundation // Clang module
1414

15-
/// Keys used in the result of `URLResourceValues.thumbnailDictionary`.
16-
@available(OSX 10.10, iOS 8.0, *)
17-
public struct URLThumbnailSizeKey : RawRepresentable, Hashable {
18-
public typealias RawValue = String
19-
20-
public init(rawValue: RawValue) { self.rawValue = rawValue }
21-
private(set) public var rawValue: RawValue
22-
23-
/// Key for a 1024 x 1024 thumbnail image.
24-
static public let none: URLThumbnailSizeKey = URLThumbnailSizeKey(rawValue: URLThumbnailDictionaryItem.NSThumbnail1024x1024SizeKey.rawValue)
25-
26-
public var hashValue: Int {
27-
return rawValue.hashValue
28-
}
29-
}
30-
3115
/**
3216
URLs to file system resources support the properties defined below. Note that not all property values will exist for all file system URLs. For example, if a file is located on a volume that does not support creation dates, it is valid to request the creation date property, but the returned value will be nil, and no error will be generated.
3317

stdlib/public/SDK/UIKit/UIKit_FoundationExtensions.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ public extension URLResourceValues {
8080

8181
/// Returns a dictionary of UIImage objects keyed by size.
8282
@available(iOS 8.0, *)
83-
public var thumbnailDictionary : [URLThumbnailSizeKey : UIImage]? {
84-
return allValues[URLResourceKey.thumbnailDictionaryKey] as? [URLThumbnailSizeKey : UIImage]
83+
public var thumbnailDictionary : [URLThumbnailDictionaryItem : UIImage]? {
84+
return allValues[URLResourceKey.thumbnailDictionaryKey] as? [URLThumbnailDictionaryItem : UIImage]
8585
}
8686
}
8787

0 commit comments

Comments
 (0)