admaDIC App Development & IT Solutions

Apple Intelligence ImagePlayground

by Annett Schwarze | 2025-04-25

ImagePlayground is an AI based image generation tool powered by Apple Intelligence.

To use ImagePlayground in SwiftUI a system sheet can be opened using the view modifier `.imagePlaygroundSheet(isPresented:,concept:,onCompletion:...)`. The feature is available since iOS 18.1.

ImagePlayground is not available in a Simulator, but can be tested on a mac with M1 or later when the app is run as a "Mac Catalyst" app. Note that Apple Intelligence is required for that and that is not available in all regions.

        
import SwiftUI
import ImagePlayground
import PencilKit

struct ImagePlaygroundView: View {
    @State var showPlayground: Bool = false
    @State var concept: String = ""

    var body: some View {
        if #available(iOS 18.1, *) {
            VStack(spacing: 20) {
                Text("Image Playground")
                    .font(.largeTitle)
                Button(action: { showPlayground.toggle() }, label: { Text("Show") })
            }
            .imagePlaygroundSheet(
                isPresented: $showPlayground,
                concept: concept,
                onCompletion: { url in
                print("url = \(url)")
            })
            .navigationTitle("Image Playground")
        } else {
            Text("Need iOS 18.1")
                .navigationTitle("Image Playground")
        }
    }
}

ImagePlayground

 

www.admadic.de | webmaster@admadic.de | Legal Notice and Trademarks | Privacy
© 2005-2007 - admaDIC | All Rights Reserved
All other trademarks and/or registered trademarks are the property of their respective owners
Last Change: Fri Apr 25 09:04:09 2025 GMT