---
title: "CFURLGetBaseURL(_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfurlgetbaseurl(_:)"
---

# CFURLGetBaseURL(_:)

Returns the base URL of a given URL if it exists.

## Declaration

```swift
func CFURLGetBaseURL(_ anURL: CFURL!) -> CFURL!
```

## Parameters

- `anURL`: The CFURL object to examine.

## Return Value

Return Value A CFURL object representing the base URL of anURL. Ownership follows the get rule. See The Get Rule.

## See Also

### Getting URL Properties

- [CFURLGetBytes(_:_:_:)](corefoundation/cfurlgetbytes(_:_:_:).md)
- [CFURLGetByteRangeForComponent(_:_:_:)](corefoundation/cfurlgetbyterangeforcomponent(_:_:_:).md)
- [CFURLGetTypeID()](corefoundation/cfurlgettypeid().md)
- [CFURLResourceIsReachable(_:_:)](corefoundation/cfurlresourceisreachable(_:_:).md)
