Search results for

SwiftUI List performance

50,605 results found

Post

Replies

Boosts

Views

Activity

Application Hangs with Nested LazyVStack When Accessibility Inspector is Active
Description I've encountered a consistent hang/freeze issue in SwiftUI applications when using nested LazyVStack containers with Accessibility Inspector (simulator) or VoiceOver (physical device) enabled. The application becomes completely unresponsive and must be force-quit. Importantly, this hang occurs in a minimal SwiftUI project with no third-party dependencies, suggesting this is a framework-level issue with the interaction between SwiftUI's lazy view lifecycle and the accessibility system. Reproduction Steps I've created a minimal reproduction project available here: https://github.com/pendo-io/SwiftUI_Hang_Reproduction To Reproduce: Create a SwiftUI view with the following nested LazyVStack structure: struct NestedLazyVStackView: View { @State private var outerSections: [Int] = [] @State private var innerRows: [Int: [Int]] = [:] var body: some View { ScrollView { LazyVStack(alignment: .leading, spacing: 24) { ForEach(outerSections, id: .self) { section in VStack(ali
4
0
240
3w
Local Updates to Live Activities ignored after push update
I'm building out a live activity that has a button which is meant to update the content state of the Live Activity. It calls a LiveActivityIntent that runs in the app process. The push server starts my live activity and the buttons work just fine. I pass the push token back to the server for further updates and when the next update is pushed by the server the buttons no longer work. With the debugger I'm able to verify the app intent code runs and passes the updated state to the activity. However the activity never updates or re-renders. There are no logs in Xcode or Console.app that indicates what the issue could be or that the update is ignored. I have also tried adding the frequent updates key to my plist with no change. I'm updating the live activity in the LiveActivityIntent like this: public func perform() async throws -> some IntentResult { let activities = Activity.activities for activity in activities { let currentState = activity.content.state let currentIndex = currentState.pageIndex ??
3
0
131
3w
List rows partially obscured by navigation bar briefly render fully opaque when switching tabs (iOS 26)
Overview In iOS 26, a List embedded in a NavigationStack inside a TabView exhibits a visual glitch when switching tabs. When the list is scrolled such that some rows are partially obscured by the navigation bar, the system correctly applies a fade/opacity effect to those rows. However, if the user switches to another tab while rows are in this partially obscured (faded) state, those rows briefly flash at full opacity during the tab transition before disappearing. This flash is visually distracting and appears to be inconsistent with the intended scroll-edge opacity behavior. The issue occurs only for rows partially obscured by the navigation bar. Rows partially obscured by the tab bar do not exhibit this flashing behavior. Steps to Reproduce: Run the attached minimal reproduction on iOS 26. Open the first tab. Scroll the list so that some rows are partially hidden behind the navigation bar (showing the native faded appearance). While rows are in this partially faded state, switch to
6
0
160
3w
Reply to ITMS-90118: Invalid routing app setting:
It sounds like you're aware of what a routing app is, but just to confirm details: A routing app provides navigational directions between two locations. It is enabled inside of an Xcode project by going to the Capabilities tab, and adding the Maps capability, which will then show you a list of checkboxes for the transportation modes by which you're able to provide navigational directions between points. Those checkboxes correspond to values added to your Info.plist file under a key named MKDirectionsApplicationSupportedModes. It sounds like you're not providing directions, but you should check to make sure the above capability isn't enabled accidentally. And if you're not providing directions, also don't enable this capability just to try and solve this error, as I've seen people get tangled up further by trying that. If all of that looks good and that capability wasn't accidentally enabled, then the next thing you should do is to open a bug report with the details of your App ID and the build number
3w
Reply to CoreBluetooth connection never starts
[quote='874071022, ball-hayden, /thread/807938?answerId=874071022#874071022, /profile/ball-hayden'] It's interesting that your guide says DevForums is not an official support channel, [/quote] That confusion is my fault, alas. Historically, DTS provided two forms of support: Formal support via technical support incidents Informal support, via the forums, mailing lists, and so on In 2024 we changed that process, putting a lot more emphasis on the forums. That way the results of our work are available to the entire developer community. As part of that we renamed technical support incidents to code-level support requests. Quinn’s Top Ten DevForums Tips was written before the 2024 change, meaning it originally used the old language. I tweaked the text slightly when that change rolled out, but re-reading it today it’s obvious that it wasn’t sufficiently clear. I’ve just updated the post to improve this. [quote='874071022, ball-hayden, /thread/807938?answerId=874071022#874071022, /profile/ball-hayden'] It
Topic: App & System Services SubTopic: Core OS Tags:
3w
NavigationBar iOS 26
Hi all, When navigating between two screens where the first uses .inline and the second .large title display mode, the NavigationBar shows visible resizing glitches during the push animation. This is especially noticeable when using a custom background color (e.g. yellow) via UINavigationBarAppearance or .toolbarBackground(Color.yellow, for: .navigationBar). I’m already using the same appearance for standard, scrollEdge, and compact, with configureWithOpaqueBackground(), but the issue remains. Is this a known UIKit or SwiftUI issue? Any recommended workaround? Thanks.
Topic: UI Frameworks SubTopic: SwiftUI
1
0
101
3w
Reply to Trailing closure passed to parameter of type 'Int' that does not accept a closure
import SwiftUI struct DocumentTemplatesView: View { @StateObject private var documentService = DocumentService.shared @State private var selectedCategory: DocumentCategory? @State private var selectedTemplate: DocumentTemplate? @State private var searchText = var body: some View { NavigationView { VStack(spacing: 0) { // Search Bar HStack { Image(systemName: magnifyingglass) .foregroundColor(.secondary) TextField(搜索模板, text: $searchText) if !searchText.isEmpty { Button(action: { searchText = }) { Image(systemName: xmark.circle.fill) .foregroundColor(.secondary) } } } .padding() .background(Color(.systemBackground)) // Templates List if documentService.isLoading && documentService.categories.isEmpty { ProgressView(加载中...) .frame(maxWidth: .infinity, maxHeight: .infinity) } else if documentService.categories.isEmpty { VStack(spacing: 20) { Image(systemName: doc.text) .font(.system(size: 60)) .foregroundColor(.gray) Text(暂无文书模板) .font(.headline) .foregroundColor(.gray) Button(重新加载) {
Topic: UI Frameworks SubTopic: SwiftUI Tags:
3w
LocationButton (SwiftUI) broken or changed in iOS 26?
I just spend the morning debugging LocationButton and the associated CLLocationManagerDelegate only to realise that it works perfectly in iOS 18.5 but no longer works for me in iOS 26.0, 26.2 or 26.2.1 (the latter on-device). It does work when I run my app on macOS 26.2 (Designed for iPad). Is there a change in behaviour or requirements on iOS I am missing? On iOS 18.5 I observe that the authorisation status changes from .notDetermined to .authorizedWhenInUse after the LocationButton has been tapped and my delegate is able to obtain the location through locationManager(_ , didUpdateLocations:). On iOS 26.x the authorisation status remains .notDetermined and my delegate receives locationManager(_:didFailWithError:) with error code .denied. Setting NSLocationWhenInUseUsageDescription in my Info.plistdid not help. Just in case ;) FB21798098 (SwiftUI LocationButton fails to acquire authorization on iOS 26)
1
0
118
3w
Reply to NETransparentProxyProvider frequent tunnel churn during Dark Wake cycles on macOS.
[quote='814079021, sdavda, /thread/814079, /profile/sdavda'] the Network Extension process is suspended [/quote] This comment suggests that you have misunderstood how sleep works on our platforms. When the system sleeps, the main CPU [1] stops running, meaning that all code on the device stops executing [2]. Now, on iOS and its child platforms we will suspend an app’s process when the app moves to the background. That mechanism is completely different from system sleep, and it doesn’t exist on macOS. [quote='814079021, sdavda, /thread/814079, /profile/sdavda'] Is it possible to suppress the sleep and wake callback methods of NETransparentProxyProvider when the device is performing a maintenance/Dark Wake … ? [/quote] Not directly. [quote='814079021, sdavda, /thread/814079, /profile/sdavda'] Is it possible to prevent the NETransparentProxyProvider process from being suspended during sleep … ? [/quote] That question doesn’t make sense given the design that I’ve outlined above. [quote='814079021, sdavda
3w
iOS 26.2 Keyboard shows asymmetric horizontal padding (left edge flush, right padded) in both UIKit & SwiftUI
On iOS 26.01 & 26.2, the system keyboard shows uneven horizontal padding: Leftmost key column touches the screen edge Right side has visible padding This behavior is reproducible: In existing apps In a brand-new demo app In both UIKit and SwiftUI Xcode: 26.0.1 & 26.2 iOS: 26.0.1 & 26.2 Simulator Devices tested: iPhone 15 / iPhone 15 Pro Keyboard types: .numberPad, .decimalPad Frameworks: UIKit, SwiftUI
0
0
141
3w
SwiftUI Performance vs identity
In SwiftUI, it is recommended not to store ViewBuilder closures in sub-views but instead evaluate them directly in init and store the result (example: https://www.youtube.com/watch?v=yXAQTIKR8fk). That has the advantage, as I understand it, that the closure doesn't need to be re-evaluated on every layout pass. On the other side, identity is a very important topic in SwiftUI to get the UI working properly. Now I have this generic view I'm using with a closure which is displayed in two places (HStack & VStack). Should I store the closure result and get the performance improvements, or evaluate it in place and get correct identities (if that is even an issue)? Simplified example: struct DynamicStack: View { @ViewBuilder var content: () -> Content var body: some View { ViewThatFits(in: .horizontal) { HStack { content() } VStack { content() } } } } vs struct DynamicStack: View { @ViewBuilder var content: Content var body: some View { ViewThatFits(in: .horizontal) { HStack { conten
0
0
71
3w
Basic introduction to DEXT Matching and Loading
Note: This document is specifically focused on what happens after a DEXT has passed its initial code-signing checks. Code-signing issues are dealt with in other posts. Preliminary Guidance: Using and understanding DriverKit basically requires understanding IOKit, something which isn't entirely clear in our documentation. The good news here is that IOKit actually does have fairly good foundational documentation in the documentation archive. Here are a few of the documents I'd take a look at: IOKit Fundamentals IOKit Device Driver Design Guidelines Accessing Hardware From Applications Special mention to QA1075: Making sense of IOKit error codes,, which I happened to notice today and which documents the IOReturn error format (which is a bit weird on first review). Those documents do not cover the full DEXT loading process, but they are the foundation of how all of this actually works. Understanding the IOKitPersonalities Dictionary The first thing to understand here is that the IOKitPersonalities is called that
0
0
128
3w
Reply to SwiftUI ScrollView scrollTo not consistently scrolling to latest message
You can’t scroll to an item added in the same update; by the time you call scrollTo, the system don’t know about the new item. The right way to do this is to use onChange so that SwiftUI enqueues a new update once the collection has propagated through. Like so: struct ContentView: View { @State private var items = Array(0 ..< 20) var body: some View { NavigationStack { ScrollViewReader { proxy in List { ForEach(items, id: .self) { item in Text(Row (item)) .onTapGesture { proxy.scrollTo(item, anchor: .bottom) } } } .toolbar { Button { let newItem = items.count items.append(newItem) } label: { Image(systemName: plus) } } .onChange(of: items.count) { proxy.scrollTo(items.count-1, anchor: .bottom) } } } } } Let me know if this helps, and if you have any further questions please share a sample code that reproduces the issue. That'll be helpful in getting more context.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
3w
Reply to NSFileSandboxingRequestRelatedItemExtension: Failed to issue extension
The files, both user-selected and sidecar, reside in a folder inside my user’s document folder, and I try to read the sidecar when the user opens the audio file. OK. SO, one thing I would test here is what happens if you test the same code with files that are in a directory outside of the normal user hierarchy. You can try with a directory inside your home directory, but I actually suggest using a folder ENTIRELY outside the user hierarchy— for example, on a disk image or an external volume. The issue here is that macOS has multiple independent systems of data protection, most of which are focused on user data (like the contents of ~/Documents/). Moving outside of that hierarchy means you’re looking at the basic case, which is easier to evaluate. Looking at the other cases here: I can access the sidecar file from the terminal and load its content. FYI, Terminal.app is a tricky tool to test an experiment with. The issues here are: It's not sandboxed, which exempts it from the more aggressive file protection yo
Topic: App & System Services SubTopic: Core OS Tags:
3w