Value of type 'URLResourceValues' has no member 'tagNames'

I got this error despite documentation saying it exits:

https://developer.apple.com/documentation/foundation/urlresourcevalues/tagnames

I'm building for iPadOS 26.2

Answered by DTS Engineer in 873371022

Tag names are not available on iOS. Xcode does a pretty good job of explaining that. Consider this snippet:

let values = try url.resourceValues(forKeys: [.tagNamesKey])
                                            // ^ 'tagNamesKey' is unavailable in iOS
let tags = values.tagNames ?? []

That fact is also reflected in the documentation for the tagNamesKey property.

I’m not sure why the documentation for the tagNames property gets this wrong, but it’s definitely a bug in the docs and I encourage you to file it as such.

Please post your bug number, just for the record


Taking a step back, I can see why you might want to work with tags on iOS, so I encourage you to file a separate enhancement request asking for this property to be made available there.

Again, please post your bug number.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Tag names are not available on iOS. Xcode does a pretty good job of explaining that. Consider this snippet:

let values = try url.resourceValues(forKeys: [.tagNamesKey])
                                            // ^ 'tagNamesKey' is unavailable in iOS
let tags = values.tagNames ?? []

That fact is also reflected in the documentation for the tagNamesKey property.

I’m not sure why the documentation for the tagNames property gets this wrong, but it’s definitely a bug in the docs and I encourage you to file it as such.

Please post your bug number, just for the record


Taking a step back, I can see why you might want to work with tags on iOS, so I encourage you to file a separate enhancement request asking for this property to be made available there.

Again, please post your bug number.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Value of type 'URLResourceValues' has no member 'tagNames'
 
 
Q