[swift-users] getResourceValue
J.E. Schotsman
jeschot at xs4all.nl
Fri Jan 6 08:37:42 CST 2017
> On 06 Jan 2017, at 14:39, Rod Brown <rodney.brown6 at icloud.com> wrote:
>
> Hi Jan,
>
> The Swift 3 URL struct has a modernized version of the NSURL API which works far better in Swift. This replaces “getResourceValue(…)” with the API you mentioned: “resourceValues(forKeys:)”.
I still feel the need to extend URL with properties like name, parentFolder etc.
> If you want to use the old API, you can simply cast back to NSURL if you require the old behaviour.
That isn't necessary for structs conforming to ReferenceConvertible. You just need to import Foundation.
IMO there is a natural class hierarchy here, like
URL -> File
URL -> Folder -> Volume
URL -> Alias
So I am going the opposite way at the moment (double wrapper, ugh!).
Jan E.
More information about the swift-users
mailing list