Delve into the world of built-in app and system services available to developers. Discuss leveraging these services to enhance your app's functionality and user experience.

Post

Replies

Boosts

Views

Activity

PDFKit PDFPage.characterBounds(at:) returns incorrect coordinates iOS 18 beta 4
PDFKit PDFPage.characterBounds(at: Int) is returning incorrect coordinates with iOS 18 beta 4 and later / Xcode 16 beta 4. It worked fine in iOS 17 and earlier (after showing the same issue during the early iOS 17 beta cycle) It breaks critical functionality that my app relies on. I have filed feedback (FB14843671). So far no changes in the latest betas. iOS release date is approaching fast! Anybody having the same issue? Any workaround available?
8
1
862
Aug ’24
How to update data in a DataFrame
My project loads a CSV into a DataFrame and displays it in a Table (a MacOS app). So far so good ... but when trying to update a value in a column, I dont see anyway to update this value. The table gets the value for the column like this: func getColumnValue(row :DataFrame.Rows.Element, columnName :String) -> String { if row.base.containsColumn(columnName) { var value = "" if row[columnName] != nil { value = "\(row[columnName]!)" } return value } ... But the documentation and googles dont show any way to update the same column. Any help is appreciated with cookies. Attempt to update: func setColumnValue(row :DataFrame.Rows.Element, columnName :String, value :String) { var column: [String?] = data[columnName] column[row.id] = value ... }
3
0
143
4d
Finder File Previews lock files on SMB shares
I've developed a new Quicklook data-based preview extension for a custom file type that generates an image preview of the file. I previously used a Quick Look generator plug-in but support for it was deprecated and now removed in macOS Sequoia. My app opens files using a open(url.path, O_RDWR | O_NONBLOCK | O_EXLOCK) call. The locking flags are used to prevent other clients from writing the file if it's already open. I discovered that when Finder is showing the “large” file previews (such as when in column or gallery modes) from a SMB share, the open call fails with EWOULDBLOCK as if the file is locked. It does work just fine on local files. Opening with O_SHLOCK also has the issue. Surprisingly it does work just fine for previews that return Plain Text data instead of Image data. Using the lsof command, it seems like the Quicklook process has some kind of lock on the file. This is the output of the lsof command: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE QuickLook 48487 XXXX txt REG 1,15 125000611 3161369 Attached is a test project that tries a few different opening and locking functions. It also includes a test file and a sample image preview extension that displays a red square. When everything is working, regular console messages show the progress of the tests. When the file is on a SMB share and selected in Finder Gallery mode, the open test will fail with a fault message in the console. Notably, locking with flock works, which is weird because it should have similar semantics according to the man page for open(2). Filed this as FB15051186
0
0
24
7h
BarcodeObservation Orientation
Hi, I'm working with vision framework to detect barcodes. I tested both ean13 and data matrix detection and both are working fine except for the QuadrilateralProviding values in the returned BarcodeObservation. TopLeft, topRight, bottomRight and bottomLeft coordinates are rotated 90° counter clockwise (physical bottom left of data Matrix, the corner of the "L" is returned as the topLeft point in observation). The same behaviour is happening with EAN13 Barcode. Did someone else experienced the same issue with orientation? Is it normal behaviour or should we expect a fix in next releases of the Vision Framework?
0
0
16
9h
How does the Reddit app detect Safari’s Private Browsing mode when opening a Universal Link?
I’m trying to understand how the Reddit app knows to open in its anonymous mode when a link is opened from Safari’s Private Browsing mode. Does Safari explicitly pass any flag or metadata indicating the request originated from Private Browsing? Or is it inferred by the absence of shared cookies, session tokens, or other stateful data? If the detection is based on the absence of cookies, could this logic misidentify other stateless scenarios as ‘private’?
0
0
22
11h
Why is applicationWillEnterForeground called on first launch when using AppIntent with openAppWhenRun = true?
Hello, I’ve implemented a feature in my app using AppIntent. When the app is not running in the background and is launched for the first time via a shortcut, both application:didFinishLaunchingWithOptions: and applicationWillEnterForeground: are called. Normally, on the first launch, applicationWillEnterForeground: is not invoked. However, this behavior seems to occur only when the app is launched through a shortcut. I’d like to understand why applicationWillEnterForeground: is being called in this scenario. For reference, the AppIntent has openAppWhenRun set to true. Thank you in advance for your help!
3
0
151
4d
Live Activity Dissappearing
Hello, I am experiencing an issue with the Live Activity feature in my application. Despite extensive debugging efforts, the problem persists, and I would greatly appreciate your assistance. Here are the key details of the issue: We are not using APNS; everything related to Live Activities is handled locally within the app. The Live Activity displays task details, including: Task title, icon and A label functioning as a timer that shows the remaining time in seconds for the task. The Live Activity appears as expected when the app is opened. However, when the app is sent to the background, the Live Activity does not appear consistently. It disappears unexpectedly in some random instances. I have tried various debugging methods, including: Ensuring the activity is correctly created and updated as per the Apple Documentation. Verifying the ActivityAttributes and ActivityContentState configurations. Testing with different app lifecycle events to determine when the issue occurs. Despite these efforts, the issue remains unresolved, and the cause is unclear. The app behavior seems inconsistent, as the Live Activity sometimes remains visible and at other times disappears when the app is backgrounded. I would greatly appreciate your help in understanding and addressing this issue. Specifically: Are there any system-level constraints or conditions that could cause a Live Activity to terminate when the app is backgrounded? Are there best practices or configurations to ensure the persistence of locally managed Live Activities? Can you suggest additional debugging techniques or tools that could help identify the root cause? Thank you for your time and support. Please let me know if further information or logs are needed to assist in troubleshooting STEPS TO REPRODUCE Download and Install the Owaves App from the App Store. Create a Live Activity: Open the app and create an activity for the current time on Today. Example: If the current time is 9:30 AM, create an activity with a time range such as 9:00 AM - 10:00 AM to ensure it is live. Enable Live Activity: Tap on the newly created activity to open the Event Details page. Scroll to the bottom of the page and locate the toggle switch labeled "Live Activity". Switch the toggle to the ON position to enable the Live Activity. Background the App: Send the app to the background. Check the Lock Screen: Swipe down to enable iOS' Lock Screen and check for the Live Activity from the Owaves app. Repeat the Steps: If the Live Activity appears on the Lock Screen initially, repeat steps 3-5 multiple times. Eventually, you will encounter instances where the Live Activity does not appear on the Lock Screen, despite following the same process
1
0
50
18h
App Intents: How to test intent donation using IntentDonationManager?
Hello! I'm trying to donate an Intent to iOS using IntentDonationManager, following the methods described in the documentaion. try await IntentDonationManager.shared.donate(intent: MyIntent()) // succeeded However, I'm not seeing any effect of this action anywhere in the system (iOS 17 and 16). I have debugged it on both the simulator and a physical device, and I have also enabled the "Display Recent Shortcuts" toggle in the developer settings, but I still don't see any relevant suggestions appearing. Similarly, the issue also occurs with the old SiriKit framework, where INInteraction.donate(completion:) doesn't seem to have any observable effect. I recall that in iOS 15, the simulator would immediately present the donated Shortcut action on the lock screen and Spotlight page. However, starting from iOS 16 and continuing to the current iOS 17 beta 1/2, I haven't been able to achieve the same behavior using the same code. Another similar report: https://developer.apple.com/forums/thread/723109 So is there any way to test or verify the results of this donation action?
4
0
1.3k
Jun ’23
Photos crashes when working with face circles and names in expanded view
On an Intel Mac, in Photos show the information window, then click + to add a face circle. Enlarge the view, then drag to position the circle. The position and size of the circle are unstable, as is text typed into the Name field of the circle. Try to type a name in the name text field. Sometimes the text disappears, then later reappears. The reappearing text can be from various bits of text that previously were typed. In expanded view sometimes dragging the circle causes Photos to crash, more often the circle jumps to some position other than where it was dragged, or where it was before dragging. While dragging to move the entire circle can cause the circle to jump to unpredictable locations or crash, making the circle larger or smaller does not cause a crash, so long as the position is not changed. In some cases the new location to which the circle jumps can be outside the pane that contains the photo's image. This seems to resemble the bug enabling CVE-2024-11691: Out-of-bounds write in Apple GPU drivers via WebGL. That bug is said to involve WebGL operations on Apple silicon M series devices, and thus only affect Apple M series hardware. In contrast, the bug I am reporting occurs in Intel code on my MaPro7,1 with AMD gpu, and seems not present on my M1 MaBookPro. I have sent many automatically generated crash reports, and Feedbacks with extensive System Diagnostics etc reports. I have been sending such feedback a long time (years?) through several iterations of macOS. I tried to open a case with standard Apple support. I was told I could not because I am using beta software (macOS 115.2 Beta (24C5089c)), and that I should work through the developer program. So here I am. I think this bug should get more attention. Please advise me if there is a better way or place to post this.
0
0
69
20h
Intermittent App Package Installation failure.
I work on a macOS application that functions as a daemon. To test it, I: Compile executables. Use pkgbuild and productbuild to build an application bundle. Use codesign and notarytool to sign and notarize the app. Install the app with /usr/sbin/installer -target LocalSystem -pkg .... This often overwrites the previous version of the app. Sometimes, the installation fails at the postinstall stage, when it can not find the application's install directory. We explicitly check for this error in our script: if ! [ -d "$APP_INSTALL_DIR"/Contents ]; then echo "directory ${APP_INSTALL_DIR}/Contents is missing" exit 1 fi This is unexpected! Even worse, some of our customers have occasionally seen the same issue! We use a postinstall script in order to install files into the /Library/LaunchDaemons and /Library/ LaunchAgents directories, and start the agent with launchctl bootstrap. Our preinstall script makes sure that the previous version of our application is fully uninstalled (so there is no confusion), and we wonder if that is part of the problem. While researching this error, I ran across a discussion of a similar issue on Stackoverflow: <https:// stackoverflow.com/questions/19283889>. One of the commenters there wrote: It appears that the OS X installer uses information about already installed packages and application bundles in order to decide where and if to install new packages. As a result, sometimes my installer did not install any files whatsoever, and sometimes it just overwrote the .app bundle in my build tree. Not necessarily the one used to build the installer, but any .app bundle that OS X had found. In order to get the installer to install the files properly I had to do two things: Tell OS X to forget about the installed package. sudo pkgutil --forget <package id> Not sure if this is needed for you nor in my case, but it is probably a good idea anyway. Delete all existing .app bundles for the app. If I didn't do this, the existing app bundle was overwritten on install instead of the app being placed in /Applications. Maybe there is a way to prevent this while building the installer package, but I haven't found it. On the other hand, the man page for pkgutil says not to use --forget from an installer: Discard all receipt data about package-id, but do not touch the installed files. DO NOT use this command from an installer package script to fix broken package design. What is the correct approach to fix this problem?
5
0
339
Jul ’24
Namedrop style AirDrop is not working.
PLATFORM AND VERSION Xcode Version 16.2 beta 3 (16C5023f) macOS 15.1.1 (24B91) Run-time configuration: iOS 18.0 DESCRIPTION OF PROBLEM We are currently testing the functionality of AirDrop by bringing iPhones close to each other. I am trying to transfer the activityItemsConfiguration set in the modal screen via AirDrop. However, if presentationStyle is fullscreen, it succeeds, but otherwise the connection is successful but no item is displayed on the screen. STEPS TO REPRODUCE Open my project. Run on device Tap Present with toggle is off. ModalViewController presented as sheet. Bring another iPhone closer Play connection animation, then just display connected.
1
0
58
1d
Crash occurs in both @MainActor classes and functions on iOS 14
Crash occurs in @MainActor class or function in iOS 14 Apps built and distributed targeting Xcode 16 version swift6 crash on iOS 14 devices. We create a static library and put it in our app's library. Crash occurs in all classes or functions of the static library (@MainActor in front). It does not occur from iOS / iPadOS 15. If you change the minimum supported version of the static library to iOS 11, a crash occurs, and if you change it to iOS 14, a crash does not occur. Is there a way to keep the minimum version of the static library at iOS 11 and prevent crashes?
1
0
114
1w
How to "upgrade" an HTTP connection to a WebSocket
Hi, I have been successful at writing Swift code using a NWListener to listen to WebSocket connections on a specific port, but I do not seem to be able to get the path from the URL for creating different types of connections. For instance, differentiating between ws://127.0.0.1:80/updates and ws://127.0.0.1:80/changes. I'd like to be able to get the "updates" or "changes" part when I receive the new connection notification. Having more sample code around WebSockets and how the upgrade process works that would also be great. Thank you ! Daniel Tapie
3
0
3.6k
Sep ’20
How NSMutableString works under the hood ?
I want to understand how it manages memory allocation if i need more memory later than the memory i specified during initialisation . Does it allocates new chunk of memory and dellocate older memory or does it already allocated more memory than i asked for in first place? Just want to understand how exactly this calculation is done ? And i do initialisation of NSMutableString in swift , will these same principle of expension applied there ?
1
0
147
1w
Localized App Shortcuts phrases don't work with AppIntents consumed from a Framework
Imagine we have an Xcode workspace containing two projects: MyLibrary.xcodeproj holding a framework target MyShortcutsApp.xcodeproj holding an app target which consumes MyLibrary framework Both targets define App Intents and the ones from MyLibrary are exposed via AppIntentsPackage accordingly. When trying to wrap the App Intent from framework as App Shortcut and passing localized AppShortcutPhrases I do see the following compile error: ".../Resources/de.lproj/AppShortcuts.strings:11:1: error: This AppShortcut does not map to a known action (MyLibraryIntent specified). (in target 'MyShortcutsApp' from project 'MyShortcutsApp')" If I use the same localized App Shortcut phrases for an App Intent which is locally defined in the app target, everything works fine and also if I use the framework-provided App Intent in and App Shortcut without passing any localized phrases. This is happening with Xcode 16.0 (16A242d), with 16.1 (16B40) and with 16.2 beta 2 (16C5013f). I already raised this issue via FB15701779 which contains a sample project to reproduce and to further analyze the issue. Thanks for any hint on how to solve that. Frank
1
4
179
2w
Does @available work on Mac Catalyst AppKit Bundle Plugin?
A Mac Catalyst App Creates an AppKit Bundle Plugin in which @available does not work。 In AppKit Bundle Plugin, there is not watchOS and iOS version can not be higher than 28, but the log has been output. if (@available(watchOS 18.0, *)) { NSLog(@"bundle is available watchOS"); } if (@available(iOS 28.0, *)) { NSLog(@"bundle is available iOS"); } demo link: https://pan.baidu.com/s/1s_5qmsL6Bh-df3A1PfD0OA Extracted code: 5ndj
3
0
96
1w
Siri Prioritizing Incorrect Contact When Default Account is Set
Hello, I’m experiencing an issue with Siri on iOS where it prioritizes a contact from the wrong account, even though I’ve set a default account for Contacts. Details of the issue: I have two contact groups: Exchange (Outlook) — my default account. iCloud. There’s a contact, "Alena Jorse," which exists in both groups: In the Exchange group, the name is saved as Alena Jorse. In the iCloud group, it is saved as Alena Jorse with double-strike formatting (e.g., "Alena Jorse**"). Both contacts have the same phone number. When I ask Siri to call "Alena Jorse," it selects the iCloud contact ("Alena Jorse**") instead of the Exchange contact, despite Exchange being set as the default Contacts account in my iOS settings. Expected Behavior: Siri should prioritize the contact from the default account (Exchange) and ignore other accounts unless specified. Steps to Reproduce: Have duplicate contacts in two groups (Exchange and iCloud) with the same phone number. Set Exchange as the default Contacts account. Ask Siri to call the contact. Troubleshooting Steps Taken: Ensured the default account is set to Exchange. Verified both contacts have the same phone number. Tested by disabling iCloud temporarily, which resolves the issue (but is not a viable long-term solution). Request: Could you please advise if this is intended behavior or a bug? If it’s a configuration issue, how can I ensure Siri prioritizes the default account for contacts? If it’s a bug, could this be investigated further? Thank you for your assistance.
0
0
55
2d
My iOS app that I created since 2011, crashes on M4 machine (M1 is fine!)
A user gave me the crash log on his M4 machine when he first launches the app. I have M1 and my app works fine, which begs the question, why M4 has the crash! This is my app the I developed since 2011 until now. Any hints will be appreciated or anyone has similar issues like to share? ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Incident Identifier: DA1CEECB-28D4-40A9-8F0C-7125812084F4 CrashReporter Key: FB8A5DBB-7140-D370-AC72-EC158266383C Hardware Model: Mac16,3 Process: Stocks Live [5506] Path: /private/var/folders/*/Stocks Live.app/Stocks Live Identifier: com.cinnamonmobile.StocksLive Version: 34.2 (34.2.0) AppStoreTools: 16B39 AppVariant: 1:MacFamily20,1:18 Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Coalition: com.cinnamonmobile.StocksLive [2018] Date/Time: 2024-11-27 12:41:48.0456 -0500 Launch Time: 2024-11-27 12:41:47.5710 -0500 OS Version: macOS 15.1.1 (24B2091) Release Type: User Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Subtype: KERN_MEMORY_ERROR at 0x0000000120034000 Exception Codes: 0x000000000000000a, 0x0000000120034000 VM Region Info: 0x120034000 is in 0x120034000-0x120038000; bytes after start: 0 bytes before end: 16383 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL CoreAnimation 120030000-120034000 [ 16K] rw-/rwx SM=PRV ---> mapped file 120034000-120038000 [ 16K] r--/rw- SM=COW Object_id=14630bfe CoreAnimation 120038000-12003c000 [ 16K] r--/r-- SM=PRV Termination Reason: SIGNAL 10 Bus error: 10 Terminating Process: exc handler [5506] Triggered by Thread: 0 Kernel Triage: decmpfs - (arg = 0x80000001) compressor is not registered APFS - (arg = 0x200040) Pagein of compressed inode failed VM - (arg = 0x190000002d) Filesystem pagein returned an error in vnode_pagein VM - (arg = 0x0) Page has error bit set Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 CoreFoundation 0x18803f48c __CFStringCreateImmutableFunnel3 + 716 1 FincancialCoreFrameWork 0x10358d3c4 -[MOStringDocument loadFromContents:ofType:error:] + 156 2 UIKitCore 0x1ba34a67c __32-[UIDocument readFromURL:error:]_block_invoke + 104 3 libdispatch.dylib 0x187e20658 _dispatch_client_callout + 20 4 libdispatch.dylib 0x187e2fdb0 _dispatch_async_and_wait_invoke + 92 5 libdispatch.dylib 0x187e20658 _dispatch_client_callout + 20 6 libdispatch.dylib 0x187e2ef68 _dispatch_main_queue_drain + 980 7 libdispatch.dylib 0x187e2eb84 _dispatch_main_queue_callback_4CF + 44 8 CoreFoundation 0x1880f8e60 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 9 CoreFoundation 0x1880b8a4c __CFRunLoopRun + 1996 10 CoreFoundation 0x1880b7bc4 CFRunLoopRunSpecific + 588 11 HIToolbox 0x193529f64 RunCurrentEventLoopInMode + 292 12 HIToolbox 0x19352fd54 ReceiveNextEventCommon + 636 13 HIToolbox 0x19352feb8 _BlockUntilNextEventMatchingListInModeWithFilter + 76 14 AppKit 0x18bbe398c _DPSNextEvent + 660 15 AppKit 0x18c523ddc -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688 16 AppKit 0x18bbd6a64 -[NSApplication run] + 480 17 AppKit 0x18bbad2e8 NSApplicationMain + 888 18 AppKit 0x18bdfb7f4 _NSApplicationMainWithInfoDictionary + 24 19 UIKitMacHelper 0x1a28f8b38 UINSApplicationMain + 972 20 UIKitCore 0x1b99de3a8 UIApplicationMain + 148 21 Stocks Live 0x102bcc058 0x102bc4000 + 32856 22 dyld 0x187c50274 start + 2840 Thread 1:: Dispatch queue: UIDocument File Access 0 libsystem_kernel.dylib 0x187f93b8c __ulock_wait + 8 1 libdispatch.dylib 0x187e21048 _dlock_wait + 56 2 libdispatch.dylib 0x187e20dfc _dispatch_thread_event_wait_slow + 56 3 libdispatch.dylib 0x187e2ffc4 __DISPATCH_WAIT_FOR_QUEUE__ + 368 4 libdispatch.dylib 0x187e2fb70 _dispatch_sync_f_slow + 148 5 UIKitCore 0x1ba351384 -[UIDocument(UIDocumentInternal) _performBlock:synchronouslyOnQueue:] + 76 6 UIKitCore 0x1ba347ff0 __40-[UIDocument openWithCompletionHandler:]_block_invoke + 588 7 libdispatch.dylib 0x187e1e8f8 _dispatch_call_block_and_release + 32 8 libdispatch.dylib 0x187e20658 _dispatch_client_callout + 20 9 libdispatch.dylib 0x187e27c60 _dispatch_lane_serial_drain + 744 10 libdispatch.dylib 0x187e28768 _dispatch_lane_invoke + 380 11 libdispatch.dylib 0x187e337e8 _dispatch_root_queue_drain_deferred_wlh + 288 12 libdispatch.dylib 0x187e33034 _dispatch_workloop_worker_thread + 540 13 libsystem_pthread.dylib 0x187fcf3d8 _pthread_wqthread + 288 14 libsystem_pthread.dylib 0x187fce0f0 start_wqthread + 8 Thread 2: 0 libsystem_pthread.dylib 0x187fce0e8 start_wqthread + 0 Thread 3: 0 libsystem_pthread.dylib 0x187fce0e8 start_wqthread + 0
3
0
145
6d