The AuthenticatedAsyncImage struct allows you to load images asynchronously with authentication support. It provides a customizable progress view and a default image in case of errors or when the image is not available.


Screenshot 2023-06-29 at 15 57 04

  • Load images asynchronously with autethication support based on iOS 15 or later
  • Customizable appearance and behavior


  • iOS 15 or later
  • Swift 5.5 or later


Swift Package Manager

To install the AuthAsyncImage library using Swift Package Manager, follow these steps:

  1. In Xcode, open your project.
  2. Go to File > Swift Packages > Add Package Dependency.
  3. Enter the repository URL:
  4. Click Next and follow the remaining steps to add the package to your project.


  1. Import the necessary modules:

import SwiftUI
import AuthAsyncImage
  1. Create an instance of ImageData with the required parameters:
let imageData = ImageData(token: token, url: imageURL)
  1. Use AuthenticatedAsyncImage in your SwiftUI view:
  AuthenticatedAsyncImage(imageData: imageData, defaultImage: defaultImage, progressView: progressView)
  1. Customization

The SwiftUIAdaptiveActionSheet you can customize the defaultImage and progressView properties to match your app’s design.

Example Here’s an example of customizing the component:

import SwiftUI
import AuthAsyncImage

struct ContentView: View {
    let myURL = URL(string: "")
    var body: some View {
        HStack {
            AuthenticatedAsyncImage(imageData: ImageData(token: nil, url: myURL!), progressView: AnyView(ProgressView()))
                .aspectRatio(contentMode: .fit)
                .clipShape(RoundedRectangle(cornerRadius: 12))
                .frame(maxWidth: 100, maxHeight: 100)
            Text("Hello, world!")


This library is available under the MIT license. See the LICENSE file for more information.


View Github