Search results for

SwiftUI List performance

50,605 results found

Post

Replies

Boosts

Views

Activity

Reply to Listing files of a background asset
Hello! There’s not currently an API to do that directly, but you can achieve the same thing with AssetPackManager.url(for:). If you pass a directory path, such as NAV/, to that method, then you can use the standard methods on FileManager from Foundation, including contentsOfDirectory(atPath:), to explore the contents of the directory at the returned URL. For example: let url = try AssetPackManager.shared.url(for: NAV) let itemsInDirectory = try FileManager.default.contentsOfDirectory(atPath: url.path(percentEncoded: false)) for itemName in itemsInDirectory { let fullURL = url.appending(component: itemName) // Do something with the item at fullURL… } If a dedicated method in Background Assets to list the contents of a directory inside your asset packs would be useful, then please file a feedback report with details about your use case (what you mentioned in your original post should suffice) and reply to this thread with the feedback ID. Let us know if you need further assistance!
Topic: App & System Services SubTopic: General Tags:
Jan ’26
Reply to SwiftUI .task does not update its references on view update
Attempting to follow your application and its current objective when tapping the button labeled that returns without incrementing the counter. However, the previous view does increment the counter, but that is not the button you are referring to. So this will always return without incrementing and that's the button you showing: guard current >= 0 else { continuation.finish() return } This is not the button pressed that does what you want: Button { id+=1 } label: { Text(update id by 1) } But just let me know what's the goal and I'm sure many developers may help you to provide you the swiftUI code you need. Albert Pascual
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
SwiftUI .task does not update its references on view update
I have this sample code import SwiftUI struct ContentView: View { var body: some View { ParentView() } } struct ParentView: View { @State var id = 0 var body: some View { VStack { Button { id+=1 } label: { Text(update id by 1) } TestView(id: id) } } } struct TestView: View { var sequence = DoubleGenerator() let id: Int var body: some View { VStack { Button { sequence.next() } label: { Text(print next number).background(content: { Color.green }) } Text(current id is (id)) }.task { for await number in sequence.stream { print(next number is (number)) } } } } final class DoubleGenerator { private var current = 1 private let continuation: AsyncStream.Continuation let stream: AsyncStream init() { var cont: AsyncStream.Continuation! self.stream = AsyncStream { cont = $0 } self.continuation = cont } func next() { guard current >= 0 else { continuation.finish() return } continuation.yield(current) current &*= 2 } } the print statement is only ever executed if I don't click on the update id by 1 button.
1
0
173
Jan ’26
Reply to Can LiveActivityIntent open the app when tapping a Live Activity button on Lock Screen & Dynamic Island expanded view?
Thank you for your post. You have accurately observed the behavior of Live Activities! It is not possible to open an app using a LiveActivity. A LiveActivityIntent is designed for background execution. Its purpose is to perform a specific action within your app’s process without necessarily bringing the app to the foreground or displaying its UI. This is why push notifications are driven. In my opinion, this is an intentional design. A LiveActivityIntent focuses on providing quick, actionable interactions. If every tap on a LiveActivity button brought the app to the foreground, it could lead to a disruptive user experience. For the url parameter in your activityButton action, use a Universal Link. Universal Links open directly in your app if installed. If your app is not installed, they can gracefully fall back to a web page for installation. I hope this information is helpful. But looking for other developers ideas and recommendations as well. Albert Pascual
  Worldwide Developer Relations.
Jan ’26
Hybrid Wired-to-Wireless Audio Mode Using AirPods Charging Case
Many Apple users own both Bluetooth earphones (AirPods) and traditional wired earphones. While Bluetooth audio provides freedom of movement, some users still prefer wired earphones for comfort, sound profile, or personal preference. However, plugging wired earphones directly into an iPhone can feel restrictive and inconvenient during daily use. This proposal suggests a hybrid audio approach where wired earphones can be connected to a Bluetooth-enabled AirPods charging case (or a similar Apple-designed module), allowing users to enjoy wired earphones without a physical connection to the iPhone. #Problem Statement *Wired earphones offer consistent audio quality and zero latency *Bluetooth earphones provide freedom from cables *Users must currently choose one or the other *Plugging wired earphones into an iPhone limits movement and can feel intrusive in daily scenarios (walking, commuting, working) There is no native Apple solution that allows wired earphones to function wirelessly while maintaining Apple’s audi
1
0
291
Jan ’26
Issue with SwiftPM and multiple targets
Hi! I have a bigger Xcode project that has multiple targets: the main app (MainApp) helper command line tool (HelperTool) The project also lists multiple package dependencies via SwiftPM and these dependencies have dependencies between themselves. One of such packages produces a dynamic library MyFramework which is a dependency for both the main app and the HelperTool which has it listed under Build Phases > Dependencies as well as under Link with Frameworks. This builds just fine, but the issue somes when I want to add another target called AdditionalHelperTool which it has pretty much the same dependencies as HelperTool. When I add this second target, I start running into issues like the following: Multiple commands produce '[...]/Build/Products/Debug/Frameworks/MyFramework.framework/Versions/A' Target 'HelperTool' (project 'MyApp') has copy command from '[...]/Build/Products/Debug/PackageFrameworks/MyFramework.framework' to '[...]/Build/Products/Debug/Frameworks/MyFramework.framework'
3
0
137
Jan ’26
Performance Issues with ActionButton in MarketplaceKit – XPC Calls Causing UI Hangs
Hi all, I’m working on the alternative marketplace app and using MarketplaceKit and ActionButton. On the main page, users see a list of items, each with an ActionButton. I’m experiencing significant UI hangs when this page loads. What I’ve Observed: Instruments (Hangs and SwiftUI profilers) show that the hangs occur when ActionButton instances are rendered. Creating or updating ActionButton properties triggers synchronous XPC communication with the managedappdistributiond process on the main thread. Each XPC call takes about 2-3 ms, but with many ActionButtons, the cumulative delay is noticeable and impacts the user experience. I have tested on iOS 18.7 and 26.1, using Xcode 26.2. But in general, the issue is not specific to a device or iOS version. The problem occurs in both Debug and Release builds. Hangs can be severe depending on the number of items in a section, generally between 200-600 ms, resulting in noticeable lag and a poor user experience. I haven’t found much documentation on th
Topic: UI Frameworks SubTopic: SwiftUI
0
0
58
Jan ’26
Reply to Signing succeeds but validate fails with "Missing code-signing certificate"
[quote='872597022, davertay-j, /thread/812770?answerId=872597022#872597022, /profile/davertay-j'] there is mention of the first certificate is the one that matters - why? [/quote] The context here really matters: In a provisioning profile, the certificates act as an allowlist. So the profile holds a list of leaf certificates that it authorises. In a code signature, the certificates act as a chain of trust [1]. The first certificate is the leaf, the next is the one that issued the leaf, and so on until you get to a root. So when the trusted execution system evaluates code for execution, it checks whether the first certificate in the code signature is in the list of certificates in the profile. Regarding your original issue, when you check certificates it’s critical that you look at the serial number. That’s what matters when it comes to matching. If you double check that and the certificate that signed the code is in the profile then the next thing to check is whether this is the right type o
Jan ’26
Reply to NSHostingView stops receiving mouse events when layered above another NSHostingView (macOS Tahoe 26.2)
Thanks, but if you look at the demo code in my post: https://stackoverflow.com/questions/79862332/nshostingview-with-swiftui-gestures-not-receiving-mouse-events-behind-another-ns, I tried logging the hit tests for both the top and middle NSHostingViews. The logs confirm that clicks are reaching both views, but the middle layer’s button with the DragGesture still doesn’t respond. Do you know how your solution could be used here?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
Reply to Animation does not work with List, while works with ScrollView + ForEach
@Claude31 so what should I do to fix it? Regarding your issue: https://stackoverflow.com/questions/74253108/why-is-animation-not-working-in-a-list-but-is-working-in-vstack This has nothing to do with my question. Also this is not true for me: // ❌ Not animating – it animates perfectly. Regarding https://stackoverflow.com/questions/76418666/swiftui-list-animations-are-not-smooth-when-adding-elements-to-a-vstack-in-a-lis : Adding .animation modifier did not help.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
Reply to iOS and Android
I have two options that you should at least look at: If your goal is to run non-UI Swift code on Android then Swift’s Android Workgroup is making great strides on that front. If you want to extend that to SwiftUI code, there’s a third-party vendor who’s tackling that directly [1]. And to be clear, I’m not actually recommending either of these, because I’ll only recommend stuff that I’ve actually used. But you should at least factor them into your decision making. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com [1] https://skip.tools
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’26
Reply to SwiftUI menu not resizing images
Sorry I just forgot about copying the NSImage instance. I didn't see performance issue loading about 50 resized images into menus in my workspace. Solved. let nsImage = { let returnValue = icon.copy() as! NSImage nsImage.size = CGSize(width: 16, height: 16) return nsImage }() Image(nsImage: nsImage)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
Reply to NFC Secure Element / ISO7816 Entitlement Availability by Region (Indonesia)
Yes, this entitlement is restricted by region, along with other eligibility requirements. These are explained in NFC & SE Platform for secure contactless transactions under the Requirements and availability section. The list of regions which it is available in is also in that section. If this list changes, the updated list will be reflected in this section. Without a special entitlement, apps would be limited to interacting with tags that do not require secure element access. there are no workarounds for such apps based or distributed in regions where special entitlements are not available. There are no supported workarounds of this limitation, if such entitlements are not available for you, whether it is due to a region or other requirements.
Topic: Privacy & Security SubTopic: General Tags:
Jan ’26
SwiftUI menu not resizing images
I failed to resize the icon image from instances of NSRunningApplication. I can only get 32×32 while I'm expecting 16×16. I felt it unintuitive in first minutes… Then I figured out that macOS menu seems not allowing many UI customizations (for stability?), especially in SwiftUI. What would be my best solution in SwiftUI? Must I write some boilerplate SwiftUI-AppKit bridging?
1
0
90
Jan ’26