Swift Core Data - Change Location of Persistent Store

I have a program that reads in CVS data and writes it to a core data persistent store. I would like to change the location of the persistent store. Per Apple docs it appears that I should be able to achieve this by overriding it in a sub class of NSPersistentContainer. Unfortunately I have been unable to figure how to do this. Below is my attempt. The Xcode error I get is "cannot call value of non-function type URL".

final class CoreDataContainer: NSPersistentContainer {
    let storePathURL: URL = URL(string: "file:///Users/Chris/Developer/Persistent Store")!
    override class func defaultDirectoryURL() -> URL {
        return super.defaultDirectoryURL()
            .absoluteURL(storePathURL)
   }
}

defaultDirectoryURL is not a func but a class var:

class var defaultDirectoryURL: URL { get }

Actually it is also a class func. Sorry. Will take another look if I have the time.

...

So, this:

return super.defaultDirectoryURL()
            .absoluteURL(storePathURL)

The func defaultDirectoryURL() returns the default directory URL. Then you wish to get the absolute URL of that directory by using .absoluteURL -- but that is a property, not a func, and thus it doesn't have parameters. And why would you use that since you want a totally different URL for your data?

Maybe just return your storePathURL as an URL?

Swift Core Data - Change Location of Persistent Store
 
 
Q