---
title: defaultDirectoryURL()
framework: coredata
role: symbol
role_heading: Type Method
path: coredata/nspersistentcontainer/defaultdirectoryurl()
---

# defaultDirectoryURL()

Returns the location of the directory that contains the persistent stores.

## Declaration

```swift
class func defaultDirectoryURL() -> URL
```

## Return Value

Return Value An NSURL that references the directory in which the persistent store(s) will be located or are currently located.

## Discussion

Discussion This method returns a platform-dependent NSURL at which the persistent store(s) will be located or are currently located. This method can be overridden in a subclass of NSPersistentContainer.

## See Also

### Accessing the Default Directory

- [defaultDirectoryURL](coredata/nspersistentcontainer/defaultdirectoryurl-swift.type.property.md)
