---
title: NSURLQueryItem
framework: foundation
role: symbol
role_heading: Class
path: foundation/nsurlqueryitem
---

# NSURLQueryItem

An object representing a single name/value pair for an item in the query portion of a URL.

## Declaration

```swift
class NSURLQueryItem
```

## Overview

Overview In Swift, this object bridges to URLQueryItem; use NSURLQueryItem when you need reference semantics or other Foundation-specific behavior. You use query items with the queryItems property of an NSURLComponents object. important: The Swift overlay to the Foundation framework provides the URLQueryItem structure, which bridges to the NSURLQueryItem class. For more information about value types, see Working with Foundation Types.

## Topics

### Creating a Query Item

- [init(name:value:)](foundation/nsurlqueryitem/init(name:value:).md)

### Reading a Query Item’s Name and Value

- [name](foundation/nsurlqueryitem/name.md)
- [value](foundation/nsurlqueryitem/value.md)

### Initializers

- [init(coder:)](foundation/nsurlqueryitem/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
