Contents

serviceClass

The traffic characteristics network connections send and receive.

Declaration

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 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:

See Also

Customizing Connection Options