---
title: "webView(_:shouldBeginEditingIn:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webeditingdelegate/webview(_:shouldbegineditingin:)"
---

# webView(_:shouldBeginEditingIn:)

Returns whether the user is allowed to edit a range of content in a web view.

## Declaration

```swift
optional func webView(_ webView: WebView!, shouldBeginEditingIn range: DOMRange!) -> Bool
```

## Parameters

- `webView`: The web view that the user is editing.
- `range`: The section of the begin-editing request; used to determine if editing is allowed. Typically, range is not the current selection but may becomes the current selection if this method returns doc://com.apple.documentation/documentation/Swift/true.

## Return Value

Return Value true if the user is allowed to edit webView; otherwise, false.

## Discussion

Discussion This method is invoked when a web view attempts to become the first responder or when the user drops an object on it.

## See Also

### Related Documentation

- [webView(_:shouldEndEditingIn:)](webkit/webeditingdelegate/webview(_:shouldendeditingin:).md)
- [webViewDidBeginEditing(_:)](webkit/webeditingdelegate/webviewdidbeginediting(_:).md)
