Post

Replies

Boosts

Views

Activity

How do I stop iPadOS from thinking a drag is for a new window?
On iPadOS 26, dragging my draggable() View near the edge of the screen is causing a new window to open. This doesn't happen with .onDrag on iPadOS 26, or with either .draggable() or .onDrag on iPadOS 18.5. This is not something I'm intending to offer in my app, and doesn't really make sense. Is there any way to prevent this from happening? Is this a bug? I couldn't find any new documentation. The thing being dragged: the "Font" rectangle on the right side of the screen, which represents an item in my app that is reorder-able when multiple are present.
1
1
68
Jun ’25
Does Generable support recursive schemas?
I've run into an issue with a small Foundation Models test with Generable. I'm getting a strange error message with this Generable. I was able to get simpler ones to work. Is this because the Generable is recursive with a property of [HTMLDiv]? The error message is: FoundationModels/SchemaAugmentor.swift:209: Fatal error: 'try!' expression unexpectedly raised an error: FoundationModels.GenerationSchema.SchemaError.undefinedReferences(schema: Optional("SafeResponse<HTMLDiv>"), references: ["HTMLDiv"], context: FoundationModels.GenerationSchema.SchemaError.Context(debugDescription: "Undefined types: [HTMLDiv]", underlyingErrors: [])) The code is: import FoundationModels import Playgrounds @Generable struct HTMLDiv { @Guide(description: "Optional named ID, useful for nicknames") var id: String? = nil @Guide(description: "Optional visible HTML text") var textContent: String? = nil @Guide(description: "Any child elements", .count(0...10)) var children: [HTMLDiv] = [] static var sample: HTMLDiv { HTMLDiv( id: "profileToolbar", children: [ HTMLDiv(textContent: "Log in"), HTMLDiv(textContent: "Sign up"), ] ) } } #Playground { do { let session = LanguageModelSession { "Your job is to generate simple HTML markup" "Here is an example response to the prompt: 'Make a profile toolbar':" HTMLDiv.sample } let response = try await session.respond( to: "Make a sign up form", generating: HTMLDiv.self ) print(response.content) } catch { print(error) } }
4
0
143
Jun ’25