<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 12.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWParameters/serviceClass-swift.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network12NWParametersC12serviceClassAC07ServiceD0Ovp"
  },
  "title" : "serviceClass"
}
-->

# serviceClass

The traffic characteristics network connections send and receive.

```
final var serviceClass: NWParameters.ServiceClass { get set }
```

## Discussion

The `serviceClass` you use tells the system and compatible networks how to prioritize transmitted packets on Wi-Fi, Ethernet, or cellular for a given connection. Describe whether your traffic favors low latency (for immediacy), or high throughput (for bulk transfers), and the transport may schedule your outgoing packets to reflect that tradeoff.

Use [`NWParameters.ServiceClass.bestEffort`](/documentation/Network/NWParameters/ServiceClass-swift.enum/bestEffort) by default. Choose a different class only when you have a specific requirement or measurement showing that another choice improves your results on the networks your app uses.

Certain cellular networks also offer Network Slicing, which can use `serviceClass` to isolate traffic based on its expected characteristics.

## Enabling Network Slicing

There are two steps to enable Cellular Network Slicing:

- Set the entitlements in your property list for <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.networking.slicing.appcategory> and <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.networking.slicing.trafficcategory>. If you don’t entitle your app by specifying both these entitlements, your apps network connections won’t be using Cellular Network Slicing, even if supported by the carrier.
- Set this to the appropriate [`NWParameters.ServiceClass`](/documentation/Network/NWParameters/ServiceClass-swift.enum).

---

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)