I am working on an app that supports PencilKit. I want to add a '+' to the ToolPicker like Preview does to add in a custom action using the pencil. Is this possible with the current UI?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I am working on an iPadOS app that is fully SwiftUI (iOS14.0 beta1).
I am using a .popover(Menu()) to present a list of draggable elements to drag back into the main content view. But I cannot get this to work.
I set a .onDrag() on each draggable element.
If, in the onDrag(), I do not dismiss the popover ($isDisplayed = false), then the drag item cannot find anyplace to allow the drag to target. I think that this is from the popover being modal and blocking other views.
If I dismiss the popover, then a long-press to start the drag will also generally lose the item to drag. I can only maintain the drag with very specific actions being moving just as the long press turns the item into draggable element.
Any ideas on what I am doing wrong?
I am working on an app using FoundationModels to process web pages.
I am looking to find ways to filter the input to fit within the token limits.
I have unit tests, UI tests and the app running on an iPad in the simulator. It appears that the different configurations of the test environment seems to affect the token limits.
That is, the same input in a unit test and UI test will hit different token limits.
Is this correct? Or is this an artifact of my test tooling?
Topic:
Machine Learning & AI
SubTopic:
Foundation Models
I am writing a document-based app using the new SwiftUI 'App' protocol. I have a '+' button that reveals a popover. Within the popover, I have a List of buttons.
When rendering this, the simulator shows a very small rectangle and *none* of the buttons. If I change this to a VStack and ForEach, I get a set of buttons.
Is there something I am doing wrong to render a List in the Popover? I want to use the List for the separators and the 'grouped' formatting of the List view for more polish finish.
Any suggestions on how to get this to work?
import SwiftUI
enum DragAction: String {
case addEntry = "addEntry"
case addTask = "addTask"
case addAttachment = "addAttachment"
}
struct MenuItem: Identifiable {
var id = UUID()
let name: String
let iconName: String
let dragAction: DragAction
}
struct PlusPopoverMenu: View {
@Binding var isPresented: Bool
let menuItems: [MenuItem] = [
MenuItem(name: "Add Entry", iconName: "pencil.and.outline", dragAction: .addEntry),
MenuItem(name: "Add Task", iconName: "checkmark.square", dragAction: .addTask),
MenuItem(name: "Add Attachment", iconName: "rectangle.and.paperclip", dragAction: .addAttachment),
]
var body: some View {
VStack(alignment: .leading) {
ForEach(menuItems) { item in
HStack {
Text(item.name)
Spacer()
Image(systemName: item.iconName)
}
.padding(12.0)
.background(Color(UIColor.systemBackground))
.onDrag {
isPresented = false
return NSItemProvider(object: item.dragAction.rawValue as NSString) }
}
}
.listStyle(InsetGroupedListStyle())
.padding(16.0)
.background(Color(UIColor.systemGroupedBackground))
/* THis is broken in beta 1
List(menuItems) { item in
HStack {
Text(item.name)
Spacer()
Image(systemName: item.iconName)
}
.onDrag {
isPresented = false
return NSItemProvider(object: item.dragAction.rawValue as NSString) }
}
.listStyle(InsetGroupedListStyle())
.padding(16.0)
*/
}
}
Example popovermenu struct - https://developer.apple.com/forums/content/attachment/a1d4fc9b-d3b8-43a6-aa4f-b965cc7a88af
I downloaded Xcode Beta 1 on my mac (did not upgrade the OS). The target OS level of iOS26 and the device simulator for iOS26 is downloaded and selected as the target.
When I try a simple Playground in Xcode ( #Playground ) I get a session error.
#Playground {
let avail = SystemLanguageModel.default.availability
if avail != .available {
print("SystemLanguageModel not available")
return
}
let session = LanguageModelSession()
do {
let response = try await session.respond(to: "Create a recipe for apple pie")
} catch {
print(error)
}
}
The error I get is:
Asset com.apple.gm.safety_deny_input.foundation_models.framework.api not found in Model Catalog
Is there a way to test drive the FoundationModel code without upgrading to macos26?
With the new multi-windowing design in iPadOS 26, the behavior of openWindow() has changed.
In iPadOS 18, if I called openWindow(), I would go from a full-screen window to two side-by-side windows. That allowed my app to meet the goal of the user; keep some information on the screen while being able to navigate through the app in the other window.
In iPadOS 26 (beta 3), this no longer works. Instead, a new Window opens ON top of the current window. I am looking for some mechanism to help the user see that two windows are now present and then easily move them on the screen (tiled, side-by-side) or whatever else they would prefer.
I am writing a SwiftUI application, using DocumentGroup. The document UTI I need to use conforms to 'com.apple.package' not 'public.data' since it is a directory of files.
If the exported Filetype conforms to 'public.data, public.content', the DocumentGroup creates a file and passes it to me (and ends up with the name 'Untitled.hawk' (hawk is my extension).
If I change the exported FileType of 'com.apple.package', I get an error and my Document type is never instantiated.
I see the same issue on both the simulator and an iPad.
The error is:
2020-07-20 17:06:27.339598-0400 HawkMultiPlatformMockup[19622:2242164] [DocumentManager] Cannot create urlWrapper for url file:///private/var/mobile/Containers/Data/Application/5F0B4A8E-E9AB-491B-A1B2-30FC88198B91/tmp/Untitled.hawk/. error Error Domain=NSPOSIXErrorDomain Code=20 "couldn't issue sandbox extension com.apple.app-sandbox.read-write for '/private/var/mobile/Containers/Data/Application/5F0B4A8E-E9AB-491B-A1B2-30FC88198B91/tmp/Untitled.hawk': Not a directory" UserInfo={NSDescription=couldn't issue sandbox extension com.apple.app-sandbox.read-write for '/private/var/mobile/Containers/Data/Application/5F0B4A8E-E9AB-491B-A1B2-30FC88198B91/tmp/Untitled.hawk': Not a directory}.
Any ideas how to get this to work?
I am using XCODE-BETA (Version 26.0 beta (17A5241e)) on a Mac (running Sequoia 15.5) to develop an app using FoundationModel. I am testing on an iPad (iPad Pro 11 in, 2nd Gen, running iPadOS 26 Beta 3).
My app works fine when I run it in the simulator (iPad 26.0).
So I upgraded my iPad Pro to iPadOS 26 beta 3 to try it on a real device.
When I run it on the device, I get an error about symbols not found. [See details below]
Any idea what I need to change in my development configuration to allow me to run/test my app on a real device running iPadOS 26 beta 3?
Thanks in advance,
Charlie
dyld[1132]: Symbol not found: _$s6WebKit0A4PageC4loadyAC12NavigationIDVSg10Foundation10URLRequestVF
Referenced from: <65E40738-6E3A-3F65-B39F-9FD9A695763C> /private/var/containers/Bundle/Application/34F9D5CE-3E54-4312-8574-10B506C713FA/Blossom.app/Blossom.debug.dylib
Expected in: /System/Library/Frameworks/WebKit.framework/WebKit
Symbol not found: _$s6WebKit0A4PageC4loadyAC12NavigationIDVSg10Foundation10URLRequestVF
Referenced from: <65E40738-6E3A-3F65-B39F-9FD9A695763C> /private/var/containers/Bundle/Application/34F9D5CE-3E54-4312-8574-10B506C713FA/Blossom.app/Blossom.debug.dylib
Expected in: /System/Library/Frameworks/WebKit.framework/WebKit
dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libLogRedirect.dylib:/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/usr/lib/libViewDebuggerSupport.dylib
Symbol not found: _$s6WebKit0A4PageC4loadyAC12NavigationIDVSg10Foundation10URLRequestVF
Referenced from: <65E40738-6E3A-3F65-B39F-9FD9A695763C> /private/var/containers/Bundle/Application/34F9D5CE-3E54-4312-8574-10B506C713FA/Blossom.app/Blossom.debug.dylib
Expected in: /System/Library/Frameworks/WebKit.framework/WebKit
dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libLogRedirect.dylib:/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/usr/lib/libViewDebuggerSupport.dylib
I have a mac (M4, MacBook Pro) running Tahoe 26.0 beta. I am running Xcode beta.
I can run code that uses the LLM in a #Preview { }.
But when I try to run the same code in the simulator, I get the 'device not ready' error and I see the following in the Settings app.
Is there anything I can do to get the simulator to past this point and allowing me to test on it with Apple's LLM?
I have a Generable type with many elements. I am using a stream() to incrementally process the output (Generable.PartiallyGenerated?) content.
At the end, I want to pass the final version (not partially generated) to another function.
I cannot seem to find a good way to convert from a MyGenerable.PartiallyGenerated to a MyGenerable.
Am I missing some functionality in the APIs?
I am trying to use Zone Sharing in my SwiftUI app. I have been attempting to get the UICloudSharingController to show an initial share screen to pick users and the mechanism to send the invitation.
From the documentation, it appears that the UICloudSharingController .init(preparationHandler:) API is deprecated so I am not using that approach. Following the Apple documentation, I am creating a Zone Share and NOT saving it and presenting using the UICloudSharingController(share:container:) API. However, this presents a UI that is the 'mgmt' API for a Share. I can get to the UI I was expecting by tapping on the 'Share with More People' option, but I want to start on that screen for the user when they have not shared this before.
So, I found an example app from Apple at: https://github.com/apple/sample-cloudkit-zonesharing. It has the same behavior. So we can simply discuss this problem based on that example code.
How do I get the next View presented when tapping 'Share Group' to be the invitation for new users screen?
Here is the UI it presents initially:
And here is the UI (on the bottom half of the screen) I am trying to start the share process with:
Thanks,
Charlie
I am developing an app that uses CloudKit sharing. I recently upgraded my iPad to use 23A5336a. After that upgrade, I can no longer accept a share that is sent to me.
I have rebooted the iPad and logged out of the iCloud account and logged back in. Every time I get a share link and tap it, it says:
" The owner stopped sharing or your account (xxx) doesn't have permission to open it"
This same code, running on the iOS26 device can share with device running iOS18.
Is this a known defect? Anything I can do to help resolve this issue?
I am working on a document based app in SwiftUI, using the approach outlined in wwdc20-10039.
I have a DocumentGroup and an editor. All works pretty well.
However, when I launch the app, sometimes it starts with 'Recents' selected and the code shows a spinner. This never completes.
Two questions:
Is this a bug in beta1 to never complete the search in recents?
What do I need to do to get something in the 'recents' folder (or is it all 'automatic'?)
What controls if the app opens to this view or the normal file picker view?
I am developing an app that allows the user to ask it to process the clipboard contents and do something with it.
In developing a XC UI Test, I find the app stops while it waits for the user to give permission. That breaks the automation.
I tried:
let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
let allowButton = springboard.buttons["Allow Paste"]
But that does not work. Is there a way to tell the framework to automatically give the test permission to access the Paste clipboard (or to allow me to write tests to grant this)?
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
Xcode
XCTest
Testing
Swift Testing