---
title: "webViewDidChangeSelection(_:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webeditingdelegate/webviewdidchangeselection(_:)"
---

# webViewDidChangeSelection(_:)

Sent by the default notification center when the user changes the selection in the web view.

## Declaration

```swift
optional func webViewDidChangeSelection(_ notification: Notification!)
```

## Parameters

- `notification`: Always set to doc://com.apple.webkit/documentation/WebKit/WebViewDidChangeSelectionNotification. You can retrieve the WebView object by sending object to notification.

## See Also

### Related Documentation

- [webView(_:shouldChangeSelectedDOMRange:to:affinity:stillSelecting:)](webkit/webeditingdelegate/webview(_:shouldchangeselecteddomrange:to:affinity:stillselecting:).md)
