<!--
{
  "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" : "CFNetwork",
  "identifier" : "/documentation/CFNetwork/CFNetServiceScheduleWithRunLoop(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "CFNetwork"
    ],
    "preciseIdentifier" : "c:@F@CFNetServiceScheduleWithRunLoop"
  },
  "title" : "CFNetServiceScheduleWithRunLoop(_:_:_:)"
}
-->

# CFNetServiceScheduleWithRunLoop(_:_:_:)

Schedules a CFNetService on a run loop.

```
func CFNetServiceScheduleWithRunLoop(_ theService: CFNetService, _ runLoop: CFRunLoop, _ runLoopMode: CFString)
```

## Parameters

`theService`

The CFNetService that is to be scheduled on a run loop; cannot be `NULL`.

`runLoop`

The run loop on which the service is to be scheduled; cannot be `NULL`.

`runLoopMode`

The mode on which to schedule the service; cannot be `NULL`.

## Discussion

Schedules the specified service on a run loop, which places the service in asynchronous mode. The caller is responsible for ensuring that at least one of the run loops on which the service is scheduled is being run.

### Special Considerations

This function is thread safe.

Before calling this function, call [`CFNetServiceSetClient(_:_:_:)`](/documentation/CFNetwork/CFNetServiceSetClient(_:_:_:)) to prepare a CFNetService for use in asynchronous mode.

---

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)