---
title: "webPlugInMainResourceDidReceive(_:)"
framework: Objective-C Runtime
role: symbol
role_heading: Instance Method
platforms: [macOS 10.6+]
path: "objectivec/nsobject-swift.class/webpluginmainresourcedidreceive(_:)-6x7b9"
---

# webPlugInMainResourceDidReceive(_:)

Invoked when the connection receives sufficient data to construct the URL response for its request.

## Declaration

```swift
func webPlugInMainResourceDidReceive(_ response: URLResponse!)
```

## Parameters

- `response`: The URL response for the connection’s request.

## Discussion

Discussion This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to NO and the underlying NSURLConnection object for the main resource sends the connection:didReceiveResponse: message to its delegate.

## See Also

### Main resource messages

- [webPlugInMainResourceDidFailWithError(_:)](objectivec/nsobject-swift.class/webpluginmainresourcedidfailwitherror(_:).md)
- [webPlugInMainResourceDidFinishLoading()](objectivec/nsobject-swift.class/webpluginmainresourcedidfinishloading().md)
- [webPlugInMainResourceDidReceive(_:)](objectivec/nsobject-swift.class/webpluginmainresourcedidreceive(_:)-5b6f6.md)
