---
title: "init(request:scale:content:placeholder:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/asyncimage/init(request:scale:content:placeholder:)"
---

# init(request:scale:content:placeholder:)

Loads and displays a modifiable image from the specified URL load request using a custom placeholder until the image loads.

## Declaration

```swift
nonisolated init<I, P>(request: URLRequest?, scale: CGFloat = 1, @ContentBuilder content: @escaping (Image) -> I, @ContentBuilder placeholder: @escaping () -> P) where Content == _AsyncImageConditionalContent<I, P>, I : View, P : View
```

## Parameters

- `request`: The doc://com.apple.documentation/documentation/Foundation/URLRequest of the image to display.
- `scale`: The scale to use for the image. The default is 1. Set a different value when loading images designed for higher resolution displays. For example, set a value of 2 for an image that you would name with the @2x suffix if stored in a file on disk.
- `content`: A closure that takes the loaded image as an input, and returns the view to show. You can return the image directly, or modify it as needed before returning it.
- `placeholder`: A closure that returns the view to show until the load operation completes successfully.

## Discussion

Discussion Until the image loads, SwiftUI displays the placeholder view that you specify. When the load operation completes successfully, SwiftUI updates the view to show content that you specify, which you create using the loaded image. For example, you can show a green placeholder, followed by a tiled version of the loaded image: AsyncImage(request: URLRequest(url: imageURL)) { image in     image.resizable(resizingMode: .tile) } placeholder: {     Color.green } If the load operation fails, SwiftUI continues to display the placeholder. To be able to display a different view on a load error, use the init(url:scale:transaction:content:) initializer instead.

## See Also

### Loading an image with a URL request

- [init(request:scale:)](swiftui/asyncimage/init(request:scale:).md)
- [init(request:scale:transaction:content:)](swiftui/asyncimage/init(request:scale:transaction:content:).md)
