iPadOS is the operating system for iPad.

iPadOS Documentation

Posts under iPadOS tag

276 Posts
Sort by:
Post not yet marked as solved
4 Replies
971 Views
Hi, As you can see in the code below whenever I open the app in the normal mode app works fine and the detail view shows data properly. However, in split screen the app lost data of the selected item. I'm sure there is a bug in here unless I should manage it by myself which unacceptable! @main struct TestSwiftUIApp: App {     var body: some Scene {         WindowGroup {             ContentView()         }     } } struct Employee: Identifiable {     let name: String     let id: Int } struct ContentView: View {     @State     var selectedEmployeeId: Employee.ID?     let employess: [Employee] = [.init(name: "Hamed", id: 1), .init(name: "John", id: 2)]     var body: some View {         NavigationSplitView {             List(employess, selection: $selectedEmployeeId) { employee in                 Text(employee.name)             }         } detail: {             NavigationStack {                 if let employee = employess.first{$0.id == selectedEmployeeId} {                     EmployeeDetails(employee: employee)                 }             }         }     } } struct EmployeeDetails: View {     let employee: Employee     var body: some View {         Text("Detail of empolyee\(employee.name) with id: \(employee.id)")     } }
Posted
by
Post not yet marked as solved
2 Replies
925 Views
Apple Docs mentions that driver should be approved(enabled) in Settings app. I wonder is there any API available to check that driver is not enabled? To my mind, App with driver should have a following flow: Run App Check that driver is(not) enabled Display message(alert) and ask to enable driver in Settings. Optionally: provide shortcut to exact Settings page Unfortunately, it's not obvious how to check that driver is enabled.
Posted
by
Post not yet marked as solved
1 Replies
662 Views
I am getting random crash from time to time while using SwiftUI but i cannot find a way to get more context into the crash how to find the root cause? didn't even get more info while the crash happened while connected to XCode Version 14.1 (14B47b) OS Version: iPhone OS 16.1 (20B82) Release Type: User Report Version: 104 Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x000000019a9edeb4 Termination Reason: SIGNAL 5 Trace/BPT trap: 5 Terminating Process: exc handler [45365] Triggered by Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 SwiftUI 0x19a9edeb4 0x19a9c3000 + 175796 1 SwiftUI 0x19a9ede98 0x19a9c3000 + 175768 2 SwiftUI 0x19aa02da4 0x19a9c3000 + 261540 3 libswiftCore.dylib 0x1910dd138 Slice.index(after:) + 48 4 SwiftUI 0x19abd4d48 0x19a9c3000 + 2170184 5 SwiftUI 0x19ac16594 0x19a9c3000 + 2438548 6 libswiftCore.dylib 0x190f29678 BidirectionalCollection.index(_:offsetBy:) + 292 7 SwiftUI 0x19a9edd00 0x19a9c3000 + 175360 8 SwiftUI 0x19be30904 0x19a9c3000 + 21420292 9 SwiftUI 0x19bc2ffa8 0x19a9c3000 + 19320744 10 SwiftUI 0x19b7b1034 0x19a9c3000 + 14606388 11 SwiftUI 0x19b7afc20 0x19a9c3000 + 14601248 12 SwiftUI 0x19b7b21e4 0x19a9c3000 + 14610916 13 UIKitCore 0x1994e57d4 -[UICollectionView _selectItemAtIndexPath:animated:scrollPosition:notifyDelegate:deselectPrevious:performCustomSelectionAction:] + 1060 14 UIKitCore 0x1997314d4 -[UICollectionView touchesEnded:withEvent:] + 480 15 UIKitCore 0x1993e7514 forwardTouchMethod + 284 16 UIKitCore 0x1993e7514 forwardTouchMethod + 284 17 UIKitCore 0x1993e7514 forwardTouchMethod + 284 18 UIKitCore 0x1993e7514 forwardTouchMethod + 284 19 UIKitCore 0x1993185e0 _UIGestureEnvironmentUpdate + 5772 20 UIKitCore 0x199b9ce14 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 288 21 UIKitCore 0x1992dc31c -[UIGestureEnvironment _updateForEvent:window:] + 188 22 UIKitCore 0x1992e0c74 -[UIWindow sendEvent:] + 3268 23 UIKitCore 0x1992dff44 -[UIApplication sendEvent:] + 672 24 UIKitCore 0x1992df600 __dispatchPreprocessedEventFromEventQueue + 7084 25 UIKitCore 0x1993273e4 __processEventQueue + 5632 26 UIKitCore 0x199f790a4 updateCycleEntry + 168 27 UIKitCore 0x199837740 _UIUpdateSequenceRun + 84 28 UIKitCore 0x199e7efd0 schedulerStepScheduledMainSection + 172 29 UIKitCore 0x199e7e19c runloopSourceCallback + 92 30 CoreFoundation 0x1970fdf54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 31 CoreFoundation 0x19710a32c __CFRunLoopDoSource0 + 176 32 CoreFoundation 0x19708e210 __CFRunLoopDoSources0 + 244 33 CoreFoundation 0x1970a3ba8 __CFRunLoopRun + 836 34 CoreFoundation 0x1970a8ed4 CFRunLoopRunSpecific + 612 35 GraphicsServices 0x1cfb05368 GSEventRunModal + 164 36 UIKitCore 0x1995873d0 -[UIApplication _run] + 888 37 UIKitCore 0x199587034 UIApplicationMain + 340 38 libswiftUIKit.dylib 0x19fb73308 UIApplicationMain(_:_:_:_:) + 104 39 Fyzio Klinik Doctor 0x10445b2d8 static UIApplicationDelegate.main() + 104 40 Fyzio Klinik Doctor 0x10445b260 static AppDelegate.$main() + 44 41 Fyzio Klinik Doctor 0x10445b450 main + 28 42 dyld 0x1b5700960 start + 2528 Thread 1: 0 libsystem_pthread.dylib 0x1e370eb90 start_wqthread + 0
Posted
by
Post not yet marked as solved
1 Replies
1k Views
We implemented communication between Swift App and DriverKit driver using IOConnectCallAsyncStructMethod. void USBDriverClass::registerAsyncCallback(){   // Async required variables   notificationPort = NULL;   machNotificationPort = NULL;   runLoopSource = NULL;       // Async initialization   globalRunLoop = CFRunLoopGetMain();   CFRetain(globalRunLoop);       notificationPort = IONotificationPortCreate(kIOMainPortDefault);   if (notificationPort == NULL)   {     printf("Failed to create notification port for application.\n");   }       machNotificationPort = IONotificationPortGetMachPort(notificationPort);   if (machNotificationPort == 0)   {     printf("Failed to get mach notification port for application.\n");   }       runLoopSource = IONotificationPortGetRunLoopSource(notificationPort);   if (runLoopSource == NULL)   {     printf("Failed to get run loop for application.\n");   }       // Establish our notifications in the run loop, so we can get callbacks.   CFRunLoopAddSource(globalRunLoop, runLoopSource, kCFRunLoopDefaultMode);       // Establish our "AsyncCallback" function as the function that will be called by our Dext when it calls its "AsyncCompletion" function.   // We'll use kIOAsyncCalloutFuncIndex and kIOAsyncCalloutRefconIndex to define the parameters for our async callback   // This is your callback function. Check the definition for more details.   asyncRef[kIOAsyncCalloutFuncIndex] = (io_user_reference_t)AsyncCallback;   // Use this for context on the return. For example you might pass "this". But since this example is entirely static, we'll skip that step.   asyncRef[kIOAsyncCalloutRefconIndex] = (io_user_reference_t)NULL;       kern_return_t ret = kIOReturnSuccess;   uint8_t words = 4;       size_t inputSize = sizeof(StructA);   StructA structA;       structA.tag = 1;   structA.length = 0;   structA.values[0] = 0x106000;   structA.values[1] = words * sizeof(uint32_t);       size_t outputSize = sizeof(OutputData);   OutputData data;   printf("registerAsyncCallback called");       ret = IOConnectCallAsyncStructMethod(connection, MessageType_RegisterAsyncCallback, machNotificationPort, asyncRef, kIOAsyncCalloutCount, &structA, inputSize, &data, &outputSize);   if (ret != kIOReturnSuccess)   {     printf("IOConnectCallAsyncStructMethod failed with error: 0x%08x.\n", ret);   } } And when we get data from device we send data back from Driver to Swift app ivars->mUSBProbeDriverClient->AsyncCompletion(ivars->streamingDataCallback, kIOReturnSuccess, asyncData, 16); Driver should transfer data to swift app asynchronously when it's provided by USB device so we can not transfer struct synchronously. Async call back has limitation of 16 of uint64_t only and our application require larger data transfer. The logical way to transfer data using a memory buffer and as per Apple documentation they are providing this using IODataQueueDispatchSource. But they have not provided any example or showed how to use this. How to use fill buffer and use it in swift app using IODataQueueDispatchSource?
Posted
by
Post not yet marked as solved
1 Replies
1.2k Views
Hi,i have been trying out SwiftUI Table and wanted to present a details view when click on Table Row occurs, but I couldn't figure out how to "deselect" row once its been selected, while it may not be what Table was intended for, but I still think this code should be valid. (iPadOS) struct Person: Identifiable { let givenName: String let familyName: String let emailAddress: String let id = UUID() } private var people = [ Person(givenName: "Juan", familyName: "Chavez", emailAddress: "juanchavez@icloud.com"), Person(givenName: "Mei", familyName: "Chen", emailAddress: "meichen@icloud.com"), Person(givenName: "Tom", familyName: "Clark", emailAddress: "tomclark@icloud.com"), Person(givenName: "Gita", familyName: "Kumar", emailAddress: "gitakumar@icloud.com") ] @State private var selectedPeople: Person.ID? @State private var detailsViewPresented: Bool = false var body: some View {         Table(people, selection: $selectedPeople) {             TableColumn("Given Name", value: \.givenName)             TableColumn("Family Name", value: \.familyName)             TableColumn("E-Mail Address", value: \.emailAddress)         }         .onChange(of: selectedPeople) { selection in             guard selection != nil else {                 return             }             detailsViewPresented = true         }         .sheet(isPresented: $detailsViewPresented, onDismiss: {             // Trying to reset the selection             self.selectedPeople = nil         }) {             Text("Person's details")         } } Here when I press row, it gets selected and Text is presented, but row still remains selected, and yes, I could just use onTapGesture within row content if I declared TableColumn with explicit content, but it would just be added to that column and would not provide build in selection style. https://developer.apple.com/documentation/swiftui/table
Posted
by
Post not yet marked as solved
1 Replies
574 Views
hey! i have an ipad pro 11’ 2018, and everything was working fine until one day i wasn’t able to connect my apple pencil 2 to my ipad. the pencil itself gets detected it just won’t connect with my ipad. i already tried restarting, unpairing (even since i wasn’t able to pair it) and even restoring my ipad. does anyone have a solution for this?
Posted
by
Post not yet marked as solved
2 Replies
1.1k Views
I'm working on a DriverKit driver. I have it running on macOS, including a very simple client app written in SwiftUI. Everything is working fine there. I've added iPadOS as a destination for the app as demonstrated in the WWDC video on DriverKit for iPadOS. The app builds and runs on my iPad, as expected (after a little work to conditionalize out my use of SystemExtensions.framework for installation on macOS). However, after installing and running the app on an iPad, the driver does not show up in Settings->General, nor in the app-specific settings pane triggered by the inclusion of a settings bundle in the app. I've confirmed that the dext is indeed being included in the app bundle when built for iPadOS (in MyApp.app/SystemExtensions/com.me.MyApp.MyDriver.dext). I also can see in the build log that there's a validation step for the dext, and that seems to be succeeding. I don't know why the app isn't being discovered -- or in any case surfaced to the user -- when the app is installed on the iPad. Has anyone faced this problem and solved it? Are there ways to troubleshoot installation/discovery of an embedded DriverKit extensions on iOS? Unlike on macOS, I don't really see any relevant console messages.
Posted
by
Post marked as solved
10 Replies
2k Views
Please excuse my lack of understanding of what are probably fundamental concepts in iOS/iPadOS development but I have searched far and wide for documentation and haven't had much luck so far. I am not sure that what I want to do is even possible with an iPad iPadOS app. Goals: Develop a Swift iPadOS app that can digitally sign a file using a PIV SmartCard/Token (Personal Identity Verification Card): Insert a PIV SmartCard/Token (such as a Yubikey 5Ci) into the lightning port of an iPadOS device iPad (NOT MacOS) Interface with the SmartCard/Token to access the user's PIV certificate/signature and "use it" to sign a file Question 1: How to get the PIV Certificate from SmartCard/Token/Yubikey into iPadOS keychain?   * Do we need to get the PIV certificate into the iOS keychain? Is there another way to interact with a SmartCard directly?   * This should prompt the user for their PIN? Question 2: How to get our Swift app to hook into the event that the SmartCard/Token is inserted into the device and then interface with the user's certificate?   * When is the user prompted to enter their PIN for SmartCard/Token/Yubikey?   * Do we need to use CyrptoTokenKit to interface with a smartcard inserted into the lightning port of an iOS device?
Posted
by
Post not yet marked as solved
2 Replies
461 Views
Hi, Has anyone else lost access to universal control with the security patch for OSX? I have 2 iPads and an M1 Mac mini all running the latest beta software but since the last security update this morning I have lost the ability to use universal control. Tha iPads can be seen and mirrored to and universal control is switched on but no luck. All working fine prior to latest beta's. Re-starts, toggling of bluetooth, wifi, handoff, universal control done on all machines to no avail. Anyone recommend how to fix this, greatly appreciated.
Posted
by
Post not yet marked as solved
1 Replies
770 Views
Hello so i have a few apps that im getting developed on upwork and i have practically 0 knowledge as far as how anything works as far as computer science type stuff. i just want to know what is the correct procedure as far as letting somebody upload the app to my apple developer account. do i give them my AppleID and password and let them do it and then change my password after they're done? any information would be greatly appreciated. thank you
Posted
by
Post marked as solved
17 Replies
9.5k Views
On iPads after updating to iPadOS 16.4, Safari often "looses" the session cookie provided by PlayFramework: When the browser requests assets (js scripts) or when additional data is fetched by JavaScript, the session cookie is not included in the request. These secondary requests will redirect through our IAM because no session cookie is present. The IAM redirects back to the original domain with a payload so that the login session can be resumed. A new Set-Cookie header is sent in the response with the new session cookie. This causes the framework to issue a new CSRF token (that is part of the session cookie) which is different from the old one that was already rendered into a hidden form input. The browser stores this new token and includes it when it POSTs the form. The token in the body of the request is now different from the one in the cookies, causing the CSRF check to fail. We have tried different devices (Android, Windows, MacBook, and iPads) on different versions. The problem only occurs with Safari on iPad/MacBook running version 16.4, 16.4.1, or 16.5 beta. The problem cannot be reproduced using Chrome on iPad. Furthermore, the problem does not occur with private browsing in Safari. Some things we ruled out: Same behaviour on devices managed by MDM and on open devices. PlayFramework version is now updated to the latest 2.8 version. Using a separate cookie for the CSRF token (instead of the play session cookie) does not make a difference either. Modifying the Cache-Control header to cache responses more aggressively or not at all does not help. Has anyone also experienced this or similar problems?
Posted
by
Post not yet marked as solved
1 Replies
331 Views
Problem - any time I open up keyboard in any app, keyboard floats over page on the middle of the app blocking form input and is just a bad experience. Usage blocker. Has anyone seen this? very debilitating. ipad mini 6 ipados 1.16.4 - at the latest update as of writing this post. help! see in screenshot of this page the keyboard is right in middle of screen blocking actual input.
Posted
by
Post not yet marked as solved
1 Replies
1.1k Views
Given a document-based app (MyApp) using DocumentGroup: If MyApp is not open, or it is open with the Document Browser displayed, and a file compatible with MyApp is tapped in the Files app, the tapped document opens as expected in MyApp. If MyApp is open and displaying a document, then tapping a compatible document in the Files app switches to MyApp, but fails to display the tapped document, and logs the following error: [Presentation] Attempt to present <SwiftUI.UIKitNavigationController: 0x11c87dc00> on <SwiftUI.DocumentBrowserViewController: 0x129018a00> (from <SwiftUI.DocumentBrowserViewController: 0x129018a00>) whose view is not in the window hierarchy. The problem is easily demonstrated by creating a new project from the Document App template in Xcode and running it in the simulator Run the app and create a new document (Untitled) Close Untitled and create another document (Untitled 2) Close Untitled 2 Open Untitled Switch to the Files app, navigate to the MyApp folder and tap on Untitled 2 The error above will be shown in Xcode. Does anyone have any insight into how to solve this? Thank you
Posted
by
Post marked as solved
3 Replies
1.4k Views
I'm developing a SwiftUI app and have implemented app icon switching. I walk the list of CFBundleAlternateIcons from the main bundle's CFBundleIcons key at runtime to display the list of options the user can select from. All is well when running on iOS (device or simulator). However, none of the alternate icons are available when running on iPadOS (device or simulator). The project is set up with Include all app icon assets checked on the app target, and all the icon sets are in the main asset catalog and are configured as Single Size for iOS. Based on some old StackOverflow posts I've also tried switching them to All Sizes and explicitly adding images for each variant, to no avail. Just in case, I also toggled Include All App Icon Assets to Yes the project level, which had no effect. The project and app target are set with a deployment target of iOS 16.0. Using xcrun --sdk iphoneos assetutil --info on the iPad build's Assets.car file shows the relevant entries for the icon files. For example: { "AssetType" : "MultiSized Image", "Idiom" : "pad", "Name" : "BlackIcon", "NameIdentifier" : 25144, "Scale" : 1, "SHA1Digest" : "3ADDEA1FD56367BF89B8931F5D01A583F6D8C6D47EAAB8F4BB5E7FE61D7D9596", "SizeOnDisk" : 236, "Sizes" : [ "1024x1024 index:0 idiom:pad" ] } And inspecting the .car file with Asset Catalog Tinkerer shows that the various alternate icon images are indeed present. And yet, CFBundleAlternateIcons is nil when accessing the main bundle when running the app on iPadOS. Even attempting to just directly set one of the alternate icons by name results in the error UserInfo={_LSLine=198, NSUnderlyingError=0x60000290e400 {Error Domain=LSApplicationWorkspaceErrorDomain Code=-105 "iconName not found in CFBundleAlternateIcons entry" UserInfo={_LSLine=186, NSLocalizedDescription=iconName not found in CFBundleAlternateIcons entry, _LSFunction=-[LSAltIconManager _setAlternateIconName:forIdentifier:withIconsDictionary:error:]}}, _LSFunction=-[LSAltIconManager _setAlternateIconName:forIdentifier:withIconsDictionary:error:]} The file doesn’t exist. I tried to replicate the behaviour with a new project, even using the same source image files as in my project's icon sets, and everything worked as one would expect on iPadOS. So I'm left to wonder if there's something awry in my project file ... maybe. I'm at a loss for what to try/check at this point. Using Xcode 14.3 (14E222b).
Posted
by
Post not yet marked as solved
1 Replies
647 Views
steps to reproduce: create a new iPad Playgrounds project implement the minimum viable app using DocumentGroup import SwiftUI import UniformTypeIdentifiers struct TextDocument: FileDocument { var text: String init(text: String = "") { self.text = text } static var readableContentTypes: [UTType] { [.plainText] } init(configuration: ReadConfiguration) throws { guard let data = configuration.file.regularFileContents, let string = String(data: data, encoding: .utf8) else { throw CocoaError(.fileReadCorruptFile) } text = string } func fileWrapper(configuration: WriteConfiguration) throws -> FileWrapper { let data = text.data(using: .utf8)! return .init(regularFileWithContents: data) } } @main struct MyApp: App { var body: some Scene { DocumentGroup(newDocument: TextDocument()) { file in TextEditor(text: file.$document.text) } } } I can compile and run the app, and use it to open and edit or create new plain text documents, but the App Preview crashes, saying "The requested index was outside the bounds of the array." and there's a red error badge on @main I assume this is a bug, and I've submitted a feedback (FB12194610) but I'm looking for ways to work around it in the meantime. There are two annoyances the red error badge obfuscates when i really do have errors in my code I don't have previews If I comment out the DocumentGroup code and insert a WindowGroup I can make the preview successfully load long enough that I can pause it. This fixes the error badge problem, but pausing the App Preview pauses all the view previews as well. And every time I run the project it restarts the previews. And I have to run the project pretty often because I can't use the previews! So I'm hoping there's a better workaround, either by more permanently disabling App Preview, or with something like the App Preview equivalent of PreviewProvider to give me some control over how the App Preview renders.
Posted
by
Post not yet marked as solved
0 Replies
317 Views
My confirmationDialog is part of my ContentView and within some View. It displays as expected in the iPhone simulator and on my physical iPhone. It does not display on either the iPad simulator or physical iPad. It fails silently and I'm not sure what could be the issue.
Posted
by
Post not yet marked as solved
1 Replies
861 Views
In the following code, click/touch anywhere on any row of the list deletes that row. This is not expected. Only the click/touch on the "xmark" button should delete that row. import SwiftUI struct MainView: View { private let arr: [String] = ["one", "two", "three"] var body: some View { List(arr, id: \.self) {item in SecView(name: item) } } } struct SecView: View { var name: String @State private var show = true var body: some View { if show { HStack { Text(name) Button(action: { show = false }, label: { Image(systemName: "xmark") }) .border(.yellow) } } } } @main struct XApp: App { var body: some Scene { WindowGroup { MainView() } } } Please check. I ran the above code for iPAD air (5th generation).
Posted
by
Post not yet marked as solved
1 Replies
354 Views
Hello, is there any offical and always actual URL where I can get a list of all released OS versions (iOS, macOS, iPadOS etc) with release date as XML or JSON or other machine readable file format? I need this list to manage and monitor our corporate managed devices in different update rings. Thx for help.
Posted
by
Post not yet marked as solved
2 Replies
687 Views
I am trying to connect to a socket using a url, which I can confirm connects successfully when using a socket connect tool, but when I try using URLSessionWebSocketTask it fails with the error: Note: have had to replace url domain and endpoint with *example.com/endpoint` for work reasons ... NSLocalizedDescription=A server with the specified hostname could not be found.} FAIL: Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={NSErrorFailingURLStringKey=https://example.com/endpoint, NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLKey=https://example.com/endpoint} The url I provide starts with the wss prefix: let socketUrl = "wss://example.com/endpoint" ... webSocketTask = urlSession.webSocketTask(with: socketUrl) webSocketTask?.resume() but the error posted earlier indicates that the task is trying to connect using https instead (which the server does not support). I don't remember having to setup anything last time, but it has been about a year since working with these things. Have I missed something setup or app transport security settings etc?
Posted
by