---
title: "init(for:)"
framework: wifiinfrastructure
role: symbol
role_heading: Initializer
path: "wifiinfrastructure/winetworksharingprovider/init(for:)"
---

# init(for:)

Creates a provider for the specified accessory.

## Declaration

```swift
init(for accessory: ASAccessory) async throws
```

## Parameters

- `accessory`: The accessory that receives the shared networks list.

## Return Value

Return Value A new WINetworkSharingProvider configured for the specified accessory.

## Discussion

Discussion Use this initializer to establish a connection with the system for sharing networks with your accessory. note: A WINetworkSharingError for various conditions: WINetworkSharingError.accessoryTransportNotSecured: The accessory doesn’t use a secure Bluetooth transport. WINetworkSharingError.accessoryNotAuthorized: The person hasn’t authorized network data sharing to the accessory. WINetworkSharingError.accessoryNotConnected: The accessory isn’t connected when making this request. WINetworkSharingError.wifiNetworkSharingUnsupported: The device doesn’t support network sharing.
