---
title: "networkEvents(matching:)"
framework: wifiinfrastructure
role: symbol
role_heading: Instance Method
path: "wifiinfrastructure/winetworksharingprovider/networkevents(matching:)"
---

# networkEvents(matching:)

Returns an async sequence of network events, containing current shared networks and future updates.

## Declaration

```swift
func networkEvents(matching predicate: Predicate<WINetworkSharingProvider.Network>? = nil) -> some Sendable & AsyncSequence<WINetworkSharingProvider.NetworkEvent, any Error>

```

## Parameters

- `predicate`: An optional predicate for filtering the shared networks list. The default is nil, meaning you receive all networks.

## Return Value

Return Value An async sequence that delivers WINetworkSharingProvider.NetworkEvent instances whenever your app extension needs to update its network information or present UI.

## Discussion

Discussion Use this method to monitor changes to the shared networks list and respond to system events, like new network availability or sharing requests from your container app.

## See Also

### Getting network updates

- [WINetworkSharingProvider.NetworkEvent](wifiinfrastructure/winetworksharingprovider/networkevent.md)
- [WINetworkSharingProvider.Network](wifiinfrastructure/winetworksharingprovider/network.md)
