getting-started-swiftui icon indicating copy to clipboard operation
getting-started-swiftui copied to clipboard

Getting started with SwiftUI and Replicate

This is a SwiftUI template project for working with Replicate's API.

You can use this as a quick jumping-off point to build an app using Replicate's API, or you can recreate this codebase from scratch by following the guide at replicate.com/docs/get-started/swiftui

Noteworthy files

  • ContentView.swift - The main content view of the app, including the Replicate API client

Usage

Open with Xcode

xed .

Provide your Replicate API token

private var client = Replicate.Client(token: <#token#>)

Warning

Don't store secrets in code or any other resources bundled with your app. Instead, fetch them from CloudKit or another server and store them in the keychain.

See:

In Xcode, go to the "Product" menu and select "Run" (R)

For detailed instructions on how to create and use this template, see replicate.com/docs/get-started/swiftui

Example image generated with prompt "renaissance portrait of a figure holding an iPhone"