<!--
{
  "availability" : [
    "iOS: 2.0.0 - 27.0.0",
    "iPadOS: 2.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.2.0 - 27.0.0",
    "tvOS: 9.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NetService/name",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSNetService(py)name"
  },
  "title" : "name"
}
-->

# name

A string containing the name of this service.

```
var name: String { get }
```

## Discussion

This value is set when the object is first initialized, whether by your code or by a browser object. See [`init(domain:type:name:)`](/documentation/Foundation/NetService/init(domain:type:name:)) for more information.

> Backward Compatibility Note:
> This became a property in OS X v10.9 and iOS 7, but the underlying getter method (`name`) has been available since this class was first introduced.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)