Skip to content

Use the right key for the image thumbnail dictionaries in the URL resources struct #6689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/public/SDK/AppKit/AppKit_FoundationExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public extension URLResourceValues {

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

}
16 changes: 0 additions & 16 deletions stdlib/public/SDK/Foundation/URL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,6 @@

@_exported import Foundation // Clang module

/// Keys used in the result of `URLResourceValues.thumbnailDictionary`.
@available(OSX 10.10, iOS 8.0, *)
public struct URLThumbnailSizeKey : RawRepresentable, Hashable {
public typealias RawValue = String

public init(rawValue: RawValue) { self.rawValue = rawValue }
private(set) public var rawValue: RawValue

/// Key for a 1024 x 1024 thumbnail image.
static public let none: URLThumbnailSizeKey = URLThumbnailSizeKey(rawValue: URLThumbnailDictionaryItem.NSThumbnail1024x1024SizeKey.rawValue)

public var hashValue: Int {
return rawValue.hashValue
}
}

/**
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.

Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/SDK/UIKit/UIKit_FoundationExtensions.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public extension URLResourceValues {

/// Returns a dictionary of UIImage objects keyed by size.
@available(iOS 8.0, *)
public var thumbnailDictionary : [URLThumbnailSizeKey : UIImage]? {
return allValues[URLResourceKey.thumbnailDictionaryKey] as? [URLThumbnailSizeKey : UIImage]
public var thumbnailDictionary : [URLThumbnailDictionaryItem : UIImage]? {
return allValues[URLResourceKey.thumbnailDictionaryKey] as? [URLThumbnailDictionaryItem : UIImage]
}
}

Expand Down