Search results for

SwiftUI List performance

50,605 results found

Post

Replies

Boosts

Views

Activity

Reply to Behavior of Bookmark URLs and Files App Recently Deleted – Clarification and Potential Bug
Question1: Accessing deleted files via bookmark (Specification clarification) Our app saves file URLs as bookmarks, which file that user has selected on Files App or app-created, so to open a file which user has modified previously in the next launch. As a side note, you may want to take a look at this post which describes a longstanding issue which makes bookmark resolution much less reliable than it would be on macOS. When a user deletes a file in Files App (moves a file to Recently Deleted), the app can still resolve the bookmark and access the file for read/write operations. Is this behavior intended? In other words, is it correct that a bookmark can access a file that has been deleted in Files App but not permanently removed? Yes. Bookmarks are a relatively low-level file system construct compared to the Recently Deleted concept Files.app presents. As far as the bookmark system is concerned, it's just another file on disk. Question2: Overwriting a file in Recently Deleted (Potential bug) We noticed that
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’26
Reply to Accelerometer sampling rate limits for third-party iOS apps
Is there an officially supported way for third-party iOS apps to access accelerometer data at sampling rates higher than ~100 Hz? So, my first question here is why you think you need a higher sampling rate? I ask because every developer who's asked this question has done so having gone through the same general development experience: They built an initial motion analysis engine which sort of worked, but had strange/inconsistent results and/or glitches. They increased the update interval and the situation improved marginally, but not completely. They continued increasing the update interval and saw improvements without actually resolving the issue until they hit the limit. Based on that experience, they've decided that the problem is caused by update frequency and if they can JUST get data a little bit faster everything will work fine. The problem here is that, in my experience, that entire analysis was built on the fundamentally false premise that the update frequency was actually the source of the problem. I
Jan ’26
Reply to iTunes v2 notification for freeTrail enabled subscription
Upon a customer’s initial subscription, whether with or without an offer, you will receive the SUBSCRIBED notificationType. If a customer is currently in an offer period, their conversion is equivalent to a renewal, thus you would receive the DID_RENEW notificationType. For further reference, I recommend exploring the documentation provided on all the notification types sent and use cases listed at the bottom: https://developer.apple.com/documentation/appstoreservernotifications/notificationtype Additionally, at WWDC24, Alex delivered an informative talk on notifications that may prove beneficial to you. You can access it via the following link: https://developer.apple.com/videos/play/wwdc2024/10062/?time=271
Topic: App & System Services SubTopic: StoreKit Tags:
Jan ’26
failing XPC connection to SMAppService based LaunchDaemon on some macOS 26 Macs ("FATAL ERROR - fullPath is nil"?)
our app has a helper to perform privileged operations which communicates with the main app via xpc_connection* previously that helper was installed via SMJobBless() into the /Library/LaunchDaemons/ and /Library/PrivilegedHelperTools/ due to various issues with the old SMJobBless() as well as it being deprecated we have ported the helper to the new SMAppService API where the helpers do not need to be installed but remain within the app bundle ( [[SMAppService daemonServiceWithPlistName:HELPER_PLIST_NAME] registerAndReturnError:&err] ) the new approach has been used in production for a year now and works fine in most cases and seems to be more reliable than the old SMJobBless(). however, we've observed two problems with the new helper architecture. • sometimes when users update the app (with the built-in Sparkle framework), the app does not seem to have FullDiskAccess, although the checkbox in the system settings remains toggled on. only once the Mac has been restarted, things work fine again. sinc
8
0
175
Jan ’26
Reply to SwiftUI view state resetting after alert is shown
Thank you for sharing your post. I find it intriguing, but I am unable to replicate the functionality you have described on my own devices. The code works the same in all simulators I have tried. The parent SwiftUI view is a List, which is destroyed when nested view presentations and alerts are involved. While you mentioned that it works correctly on other simulators and devices, I have consistently encountered the same issue when running it on different simulators with the same configuration. I would personally implement a custom mechanism to manage when and how the sheet is presented, potentially using a combination of state flags and conditional views to avoid relying on the immediate modifier behavior or better, do not include inside a List that will be destroyed. I am still very interested in knowing what device and versions of iOS the code: List { VStack { LibraryView(title: “Show view (Loss of state)”) } } works so that I can investigate the reason, in my case, the s
Topic: UI Frameworks SubTopic: SwiftUI
Jan ’26
Picker style .menu doesn't handle nil
Here's the code... import SwiftUI enum Side: String { case left case right } struct SideView: View { @State private var name: String = @State private var side: Side? = nil var body: some View { NavigationStack { Form { Section { TextField(Name, text: $name) Picker(Side, selection: $side) { Text(Left).tag(Side.left as Side?) Text(Right).tag(Side.right as Side?) } .pickerStyle(.menu) // displays with Left selected even though side is nil // .pickerStyle(.inline) // all the other styles work as expected, nothing initially selected // .pickerStyle(.palette) // .pickerStyle(.navigationLink) } } } } } #Preview(SideView) { SideView() } Even though side is nil the .menu style displays with Left selected. Try any of the other styles. They all display with nothing initially selected. As they should when side is nil. This seems like a bug and I've submitted feedback. ID: FB21685273 Whether it's a bug or not has anyone worked around this?
Topic: UI Frameworks SubTopic: SwiftUI
1
0
121
Jan ’26
State loss and sheets dismiss on backgrounding app
I've been hitting a weird SwiftUI bug with navigation and state loss and I've managed to reproduce in a very tiny sample project. I've submitted a Feedback FB21681608 but thought it was worth posting here incase any SwiftUI experts can see something obviously wrong. The bug With deeper levels of navigation hierarchy SwiftUI will dismiss views when backgrounding the app. Any work around would be appreciated. This happens in a real app where we have to navigate to a settings screen modally and then a complex flow with other sheets. Sample code Happens in the simulator and on device. import SwiftUI struct ContentView: View { @State private var isPresented = false var body: some View { Button(Show first sheet) { isPresented = true } .sheet(isPresented: $isPresented) { SheetView(count: 1) } } } struct SheetView: View { private enum Path: Hashable { case somePath } @State private var isPresented = false var count: Int var body: some View { NavigationStack { VStack { Text(Sheet (c
Topic: UI Frameworks SubTopic: SwiftUI
1
0
108
Jan ’26
Reply to State loss and sheets dismiss on backgrounding app
Thanks for the post, this is very interesting. And thanks for the bug where includes the focused project sample. Navigating complex hierarchies in SwiftUI while maintaining state can indeed be challenging. I can try to suggest some potential workarounds and strategies to mitigate state loss issues during navigation and app backgrounding but I also want to see this issue and use your focus sample to see how the sheets are lost after being presented on the app and to see if moving state management to a parent view is the answer and understand how the views are not being shown after the background. Passing state down through view hierarchies can ensure it's retained longer than if it were localized in deeply nested views. If you're not already on the latest SwiftUI and iOS version, consider updating to see if the issue has been addressed in more recent releases. Additionally, beta versions can sometimes provide pre-release fixes. You can see the status of your feedback in Feedback Assistant. Th
Topic: UI Frameworks SubTopic: SwiftUI
Jan ’26
Reply to Entitlement for extension to have read-only access to host's task?
Thanks for the extra context. At this point I feel comfortable talking about technical stuff… Oh wait, there’s one more business-y thing. My focus is on technical stuff. I don’t work for App Review and can’t make definitive statements about their policies. OK, now let’s talk technical… Mach is a capability-based system [1]. For you to get access to a Mach port, someone who already has access must share their access with you. So, who has access? And how can you convince them to share? In this case only two entities have access: The ‘system’ The target process itself There’s no way to convince the system to share its access, at least on iOS [2]. So the only option is to get the target process to give you access to itself. In theory, this should be trivial: Your app calls mach_task_self to get a send right for its control port. It then sends your extension a copy of that right via XPC. In practice, there are complications. IMPORTANT I’ve never tried this sort of thing on iOS, so I’ve no idea whether it’ll work a
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’26
Reply to Reduce dyld overhead
OK. I don’t think you can optimise beyond that. Rather, I think you should use that as a baseline for performance work as you evolve your program. Speaking of that, An Apple Library Primer has links to various WWDC talks where the linker team discusses various topics. Most notably, the 2022 talk discusses launch times. It’s well worth a watch. Finally, just for context, the libSystem initialiser does a bunch of really critical stuff. For example, it has the code that sets up the App Sandbox, if the executable enables it. If you want to see this initialiser in action, open your true clone project, set a symbolic breakpoint on libSystem_initializer, and run it from Xcode. When you stop at the breakpoint, Xcode will show a page of disassembled code, but that’s not too hard to understand. And most of the symbols are present, so you can look up the source code in Darwin. IMPORTANT The Darwin open source isn’t guaranteed to match the source used to build the OS, but it’s usually close enough to be quite in
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’26
Reply to Persisted log entries disappeared?
Each system log entry has time to live (TTL) value. You can see evidence for this in various places within the UI. For example: % sudo log stream … TTL … 0 fseventsd: (libsystem_info.dylib) Resolve user group list … … 7 WindowServer: (SkyLight) [com.apple.SkyLight:KeyboardEvent] kCGSEventKeyUp … AFAIK there’s no supported way to override that, but if you poke around in /System/Library/Preferences/Logging on your Mac it’s not hard to see how it works. WARNING As with all implementation details, there’s no guarantee that this will actually work, or that it hasn’t worked differently in the past, or will work differently in the future. So don’t build knowledge of this into a product that you ship to a wide range of users. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’26
Reply to Content Filter Permission Prompt Not Appearing in TestFlight
Oh, there’s one more thing I should add to the above list: Open source server sample (PIR Service Example) The iOS sample code discusses this, but I can’t over-emphasise how useful it is. On that page you’ll find a link to the server’s documentation, which chock full of interesting info. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Jan ’26
Reply to App review - ipad issue
I have falsified everything for iPad in the code, am not required upload iPad photos, but the reviewers keep being told to judge how my app performs on iPad for some reason. The issue here is that iPads support running iPhone apps in compatibility mode, so all apps should work when run on an iPad. Note that this does NOT mean that their interface expands or otherwise supports the full iPad experience, but simply means that the app functions as expected in compatibility mode. __ Kevin Elliott DTS Engineer, CoreOS/Hardware
Topic: App & System Services SubTopic: Hardware Tags:
Jan ’26