<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/AsyncImage/init(url:scale:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10AsyncImageV3url5scaleACyAA0D0VG10Foundation3URLVSg_04CoreG07CGFloatVtcAGRszrlufc"
  },
  "title" : "init(url:scale:)"
}
-->

# init(url:scale:)

Loads and displays an image from the specified URL.

```
nonisolated init(url: URL?, scale: CGFloat = 1) where Content == Image
```

## Parameters

`url`

The URL 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.

## Discussion

Until the image loads, SwiftUI displays a default placeholder. When
the load operation completes successfully, SwiftUI updates the
view to show the loaded image. If the operation fails, SwiftUI
continues to display the placeholder. The following example loads
and displays an icon from an example server:

```
AsyncImage(url: URL(string: "https://example.com/icon.png"))
```

If you want to customize the placeholder or apply image-specific
modifiers — like [`resizable(capInsets:resizingMode:)`](/documentation/SwiftUI/Image/resizable(capInsets:resizingMode:)) —
to the loaded image, use the [`init(url:scale:content:placeholder:)`](/documentation/SwiftUI/AsyncImage/init(url:scale:content:placeholder:))
initializer instead.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)