Search results for

SwiftUI List performance

50,609 results found

Post

Replies

Boosts

Views

Activity

Reply to Slow rendering List backed by SwiftData @Query
So basically, could I build the Photos app (or something like it) in SwiftData. Seems to be no. Because Query cannot handle anything remotely close to the thousands of displayed objects. I tested a manual fetch on context. Performed in milliseconds as expected. But anything in Query, completely fails with like 10 seconds when it gets bad
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
Reply to System Panic with IOUserSCSIParallelInterfaceController during Dispatch Queue Configuration
Due to the very low latency of our hardware for specific commands (e.g., TEST UNIT READY). Logs reveal a severe timing conflict: The interrupt handler (Completion path) is triggered and successfully invokes BundledParallelTaskCompletion, which returns normally. Crucially, at this exact microsecond, the original UserProcessBundledParallelTasks call (Submission path) has not yet finished its loop or returned to the system. Immediately after both paths eventually return, the DEXT process crashes (Corpse), subsequently triggering a Kernel Panic. Something doesn't sounds right here. There are actually a few different things that concern me: (1) There's a reasonably long cycle to get to your interrupt handler from the kernel. I'm skeptical that there's any way for an interrupted to fire before UserProcessBundledParallelTasks finishes running unless UserProcessBundledParallelTasks is doing something that substantially delays its own process. (2) From the kernel side, how bundled commands actually work is that Proces
Topic: App & System Services SubTopic: Drivers Tags:
Jan ’26
Reply to SwiftUI Instrumentation Fails to start
Updating to XCode 26.2 and macOS Tahoe 26.2 and im now greeted with Trace file had no swiftui data this occurs if I profile with XCode and chose a template I profile with XCode and chose a blank template and manually choose SwiftUI I manually run the Instruments, manually run the app, attach and open a document in my swiftUI app however, if i DO NOT load a document (macOS based swiftui app), im able to get swiftui traces my feeling here is theres something going on with complicated traces that cause an issue modelling the data stream, or capturing the trace? Im not familiar with the nuances here but this isnt working for anything that NEEDS profiling.
Jan ’26
SwiftUI ScrollView blocked when content contains a drag gesture
I am porting my app to SwiftUI and I am hitting a wall when using ScrollView. In my application, I have nested scrollViews to represent a scheduler. outer vertical scroll view inner horizontal scroll view that allows to horizontally scroll multiple columns in the scheduler each column in the inner scroll view is a view that needs to allow for a drag to initiate the creation of a new appointment on macOS, I do a mouse-down drag, so it does not affect the scroll view and works fine on iOS, if I add a drag gesture to the column, it short circuits the scroll view and scrolling becomes disabled. To initiate the drag, there is a long-press, and that gesture is fine, only the subsequent drag gesture is problematic. I have attached URL to a test app. The UI allows you to toggle the drag gesture. Hopefully, someone can help to get it to work since I would eventually like to port the macOS target to Catalyst. Download Test App
Topic: UI Frameworks SubTopic: SwiftUI
2
0
163
Jan ’26
Using Observations with SwiftData @Model
I want to use the Observations AsyncSequence on some SwiftData @Model instances to determine if internal calculations need to be done. When a simple property is linked to the Observations it fires CONTINUOUSLY even though no change is made to the model property. Also, when I try to observe a property which is a list of another @Model type the Observations sequence does not fire when I add or remove items. I am hoping to use the async-algorithm's merge function so all the associated sequences can be combined since if any of the associated events should fire the calculation event.
4
0
2.7k
Jan ’26
Stuck in a loop between Guideline 2.1 and 2.2: Reviewer refuses 5 mins of gameplay
Title: Stuck in a loop between Guideline 2.1 and 2.2: Reviewer refuses to play for 5 minutes. Body: I am an independent developer struggling with a repetitive rejection cycle for over a month. I need advice on how to handle a clear contradiction in the review process. The Loop: Initial Rejection (2.1): Reviewer said they couldn't locate the IAP. My Action: I added a prominent IAP Test button on the title screen to skip gameplay. Second Rejection (2.2): A different reviewer said the IAP Test button is a Beta feature and not appropriate for production. My Action: I removed the button and implemented a Secret Command (Easter Egg) that enables an Assist Mode (extending the timer to 5 minutes) so the reviewer can easily clear the game and reach the IAP screen in about 5-6 minutes. Latest Rejection (2.1): The reviewer now says: While we appreciate you provide an instruction... we require a quicker way to access in-app purchases without spending significant time to play games. The Current Solution: In my next submis
5
0
331
Jan ’26
Reply to Persisting User Settings with SwiftData
I'd like to comment the second question a bit, as it hasn't been addressed yet: Sometimes when running on a new device it will create a second UserSettings while it is waiting for the original one to sync from CloudKit. When you use SwiftData + CloudKit, under the hood, the framework uses NSPersistentCloudKitContainer to synchronize data. In that environment, duplicate data is sometimes inevitable, which is discussed in great details in the following section: Remove duplicate data The solution is to de-duplicate the data. How to do so is discussed and demonstrated in the sample code. Back to what to what you intent to achieve, my suggestion will be: If you plan to use SwiftData + CloudKit extensively in your app, you might need to handle duplicate data anyway. In this case, persisting user settings to your SwiftData store (and Synchronizing them via NSPersistentCloudKitContainer) makes a lot of sense. If the target is as simple as saving some Cloud-based user settings, I'd probably consider NSUbiquitousKeyVal
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
Persisting User Settings with SwiftData
I was wondering what the recommended way is to persist user settings with SwiftData? It seems the SwiftData API is focused around querying for multiple objects, but what if you just want one UserSettings object that is persisted across devices say for example to store the user's age or sorting preferences. Do we just create one object and then query for it or is there a better way of doing this? Right now I am just creating: import SwiftData @Model final class UserSettings { var age: Int = 0 var sortAtoZ: Bool = true init(age: Int = 0, sortAtoZ: Bool = true) { self.age = age self.sortAtoZ = sortAtoZ } } In my view I am doing as follows: import SwiftUI import SwiftData struct SettingsView: View { @Environment(.modelContext) var context @Query var settings: [UserSettings] var body: some View { ForEach(settings) { setting in let bSetting = Bindable(setting) Toggle(Sort A-Z, isOn: bSetting.sortAtoZ) TextField(Age, value: bSetting.age, format: .number) } .onAppear { if settings.isEmpty { context.insert(Us
3
0
422
Jan ’26
NavigationStack back button ignores tint when presented in sheet
[Also submitted as FB21536505] When presenting a NavigationStack inside a .sheet, applying .tint(Color) does not affect the system back button on pushed destinations. The sheet’s close button adopts the tint, but the back chevron remains the default system color. REPRO Create a new iOS project and replace ContentView.swift with the code below. —or— Present a .sheet containing a NavigationStack. Apply .tint(.red) to the NavigationStack or sheet content. Push a destination using NavigationLink. EXPECTED The back button chevron adopts the provided tint color, consistent with other toolbar buttons and UIKit navigation behavior. ACTUAL The back button chevron remains the default system color. NOTES Reproduces consistently on: iOS 26.2 (23C54) iOS 26.3 (23D5089e) SCREEN RECORDING SAMPLE CODE import SwiftUI struct ContentView: View { @State private var isSheetPresented = false var body: some View { Button(Open Settings Sheet) { isSheetPresented = true } .sheet(isPresented: $isSheetPresented) { NavigationSta
3
0
142
Jan ’26
Reply to Foundation Models: Is the .anyOf guide guaranteed to produce a valid string?
After experimenting with this code a bit I can see one potential issue: if you first initialize the SectionReader Tool with an empty list [] for sections, the .anyOf guide doesn't properly initialize and isn't enforced. I can't tell from the above code when you are initializing SectionReaderTool, but here's an important rule: When you initialize your LanguageModelSession with a tool, e.g. let session = LanguageModelSession(tools: [SectionReaderTool(.....)]), the property parameters will be computed at that time and the schema it produces will be added to the LanguageModelSession's instructions. Once the tool definition is in the instructions, it's never updated. What that means, is if you end up changing your SectionReaderTool or sections at any time after that, the model will never see your updates. So in theory, if you sometimes were to have an empty list [] initially for the tool, the anyOf would never work, even if you later added sections to the list. If that's not your issue,
Jan ’26
Reply to Using Observations with SwiftData @Model
I am working on the real project. The changes to the list of @Model are still not being captured in the Observations. When I modify or add/remove from the list sometimes a property of the object that IS NOT changed shows as being changed. That property has exactly one setter call and is not linked to the edit, add, or remove code. When I tried to observe the list as a whole, I achieved a FATAL ERROR for illegal attempt to resolve a future for a relationship that doesn't have a cached value!
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’26
Reply to System Panic with IOUserSCSIParallelInterfaceController during Dispatch Queue Configuration
Hi Kevin, Thank you for your previous guidance. We have shifted our driver architecture to the UserProcessBundledParallelTasks model with Shared Command/Response Buffers to optimize I/O performance. But, we are encountering a persistent Kernel Panic / DEXT Crash (Corpse) immediately after switching to the Bundled mode, preventing the target discovery and initialization sequence from completing, while the legacy mode (UserProcessParallelTask) is rock-solid and stable. Implementation Details: Memory Mapping: Successfully implemented UserMapBundledParallelTaskCommandAndResponseBuffers. DEXT correctly obtains the virtual addresses for both buffers. Dispatching: Inside UserProcessBundledParallelTasks, we iterate through the parallelRequestSlotIndices, reading from the shared command buffer and dispatching tasks to the hardware. Completion: Upon hardware completion, we populate the shared response buffer in the asynchronous path (ISR/Poll) and invoke BundledParallelTaskCompletion with the corresponding OSA
Topic: App & System Services SubTopic: Drivers Tags:
Jan ’26
Reply to Unable to run embedded binary due to quarantine
Thank you so much for answering! Contents/Resources is not the right place for a helper tool. Thanks, I'll try to move it. This is historically the place I've seen such tools to be placed (including Apple software in the past - but we're talking about 10-15 years ago) and I just kept putting the binaries there... But you are right, when I think about it, it is probably incorrect place. I suspect that the wrapper applied by the pp tool is actually unpacking code into the temporary directory and then running that. Huh! That did not occur to me! I suspected that this was due to App Translocation that the binary was launched from a temporary location as a result of the quarantine... So I did not even check the path! I've used FSMonitor (app for displaying fsevents in real time) and indeed, this is what happens. I fully understand this is not compatible with App Sandbox, so I will need to find another solution. Embedding Perl interpreter was on my list of possible workarounds, so I'll need to look into th
Topic: Code Signing SubTopic: General Tags:
Jan ’26
Camera Permissions Popup
We have a very strange issue that I am trying to solve or find the best practice for. We have a SwiftUI View that uses the Camera to preview. So as suggested in Apples Docs we check authorisation status and then if it's not determined we request authorisation. We also have the privacy entry in the info.plist case .notDetermined: AVCaptureDevice.requestAccess(for: .video) { accessStatusAuthorised in if !accessStatusAuthorised { self.cameraStatus = .notAuthorised } else { self.isAuthorized = true self.cameraStatus = .authorised self.startCameraSession(cameraPosition: cameraPosition) } } case .restricted: cameraStatus = .notAuthorised isAuthorized = false case .denied: cameraStatus = .notAuthorised isAuthorized = false case .authorized: cameraStatus = .authorised isAuthorized = true startCameraSession(cameraPosition: cameraPosition) break @unknown default: isAuthorized = true cameraStatus = .notAuthorised } However when we call this code it freezes the Camera feed, even when allow has been tapped. Howev
1
0
145
Jan ’26