Search results for

SwiftUI List performance

50,605 results found

Post

Replies

Boosts

Views

Activity

Reply to UIApplication.canOpenURL not working without Safari
Yes, it makes sense now, so you are letting us know the API: guard let url = URL(string: https://www.apple.com) else { return } if UIApplication.shared.canOpenURL(url) { UIApplication.shared.open(url) } else { print(Could not open URL) } Is not working? I can help you with that as there is no bugs on that api at all. I just put the simple app to open and opens safari, but if there is no browser nothing will open? import SwiftUI struct ContentView: View { var body: some View { VStack { Image(systemName: globe) .imageScale(.large) .foregroundStyle(.tint) Text(Hello, world!) }.task { guard let url = URL(string: https://www.apple.com) else { return } if UIApplication.shared.canOpenURL(url) { UIApplication.shared.open(url) } else { print(Could not open URL) } } .padding() } } #Preview { ContentView() } However the API requires an app capable of handling this request as explained here: (Launching the app brings the other app to the foreground.) If no app is capable of handling the specified scheme, the com
Topic: UI Frameworks SubTopic: UIKit
1w
Reply to SwiftUI .toolbar(placement: .keyboard) item not exposed to accessibility on iOS 26.1 (affects VoiceOver + XCUITest)
I've seen this behavior as well. Haven't been able to track down exactly why it's happening. I attempted to create a stripped down example, but couldn't recreate the same issue. A couple of things about the ToolbarItemGroup(placement: .keyboard) {} I'm investigating: My implementation is view a SwiftUI View that conforms to the ToolbarContent protocol. My implementation is part of a separate Swift Package utilized in my main project.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
1w
SwiftUI .toolbar(placement: .keyboard) item not exposed to accessibility on iOS 26.1 (affects VoiceOver + XCUITest)
Description On iOS 26.1, a ToolbarItem placed in .keyboard is no longer exposed to the accessibility hierarchy. As a result: VoiceOver cannot focus or activate the toolbar button XCUITest cannot discover the element, making the UI impossible to test TextEditor() .toolbar { ToolbarItem(placement: .keyboard) { Button(Done) { /* action */ } } } This worked correctly on previous iOS versions. The button appears visually but is missing from both VoiceOver navigation and XCUI accessibility queries. Steps to Reproduce Create a new SwiftUI project. Use a simple text field with a keyboard toolbar button. Run on an iOS 26.1 device or simulator. Focus the text field to show the keyboard. Turn on VoiceOver and attempt to navigate to the toolbar button. Run an XCUITest attempting to locate the button
2
0
171
1w
Live Q&A Summary - SwiftUI foundations: Build great apps with SwiftUI
Here’s a recap of the Live Q&A for SwiftUI foundations: Build great apps with SwiftUI. If you participated and asked questions, thank you for coming and participating! If you weren’t able to join us live we hope this recap is useful Where can I watch the VOD? Is the sample code “Wishlist” that was shown available for download? You can view the replay of the entire event here https://www.youtube.com/watch?v=Z3vloOtZLkQ The sample code for the Wishlist app will be made available in the coming weeks on the Apple Developer website, we'll send an update via email when it is available. What are the best practices when it comes to building complex navigations in SwiftUI? The developer website has documentation on navigation style best practices. Explore navigation basics like NavigationStack and TabView to get a ground-up understanding. For documentation on navigation APIs see Navigation. How can I integrate UIKit with my SwiftUI app? What about adding SwiftUI into my
Topic: UI Frameworks SubTopic: SwiftUI
1
0
38
1w
Reply to Live Q&A Summary - SwiftUI foundations: Build great apps with SwiftUI
Can I make the view layout conditional based on device orientation? For example, responsively switching between HStack and VStack depending on if the device is in Portrait or Landscape mode? Yes you can. In most scenarios you should prefer to make your SwiftUI view layouts conditional based on device orientation. Use AnyLayout to dynamically switch between layout containers based on orientation without destroying the state of your subviews. AnyLayout lets you change layout type at runtime while preserving view identity and state. For example, you can switch between HStackLayout and VStackLayout based on the current size class or orientation, and SwiftUI maintains your view hierarchy seamlessly. For the symbolEffect(_:options:value:) method for SF symbols, the animation only runs when the value changes. Is there a way to implement this behavior idiomatically in SwiftUI? For animations that respond to value changes, use the animation(_:value:) modifier, which applies animations automa
Topic: UI Frameworks SubTopic: SwiftUI
1w
Local Network permission on macOS 15 macOS 26: multicast behaves inconsistently and regularly drops
Problem description Since macOS Sequoia, our users have experienced issues with multicast traffic in our macOS app. Regularly, the app starts but cannot receive multicast, or multicast eventually stops mid-execution. The app sometimes asks again for Local Network permission, while it was already allowed so. Several versions of our app on a single machine are sometimes (but not always) shown as different instances in the System Settings > Privacy & Security > Local Network list. And when several instances are shown in that list, disabling one disables all of them, but it does not actually forbids the app from receiving multicast traffic. All of those issues are experienced by an increasing number of users after they update their system from macOS 14 to macOS 15 or 26, and many of them have reported networking issues during production-critical moments. We haven't been able to find the root cause of those issues, so we built a simple test app, called FM Mac App Test, that can reproduc
14
0
525
1w
Reply to enforceRoutes impact on connection speed
[quote='815475021, krzsiwek, /thread/815475, /profile/krzsiwek'] Is this behavior known and expected? [/quote] Probably [1]. But it’s useful to have a specific benchmark to highlight this cost. I recommend that you file a bug describing the issue, how you’re testing the performance, and what results you got. Please post your bug number, just for the record. [quote='815475021, krzsiwek, /thread/815475, /profile/krzsiwek'] Is there anything we can do to mitigate [this] in our application? [/quote] Not that I can think of. There isn’t really much wiggle room here. Either the property is on or off and, assuming a specific flows hits your packet tunnel provider in both cases, it sees the same set of packets for that flow. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com [1] Historically the networking stack didn’t have fancy features like enforceRoutes, and there’s been decades of optimisation for that simple case.
1w
SwiftUI view state resetting after alert is shown
Seeing an issue in iOS 26.2 iPhone 17 simulator (haven't been able to reproduce on device or other simulators), where a view's state is reset after an alert is shown. In this example the first LibraryView has the issue when alert is shown, the second LibraryView maintains state as expected. struct ContentView: View { var body: some View { NavigationStack { List { VStack { LibraryView(title: Show view (Loss of state)) } LibraryView(title: Show view (Works as expected)) } } } } /// This view is from a package dependency and wants to control the presentation of the sheet internally public struct LibraryView: View { @State private var isPresented: Bool = false let title: String public init(title: String) { self.title = title } public var body: some View { Button(self.title) { self.isPresented = true } .sheet(isPresented: self.$isPresented) { ViewWithAlert() } } } private struct ViewWithAlert: View { @State private var isPresented: Bool = false @State private var presentedCount = 0 var body: some View { B
Topic: UI Frameworks SubTopic: SwiftUI
11
0
404
1w
Reply to How to Create a Full-Width Container (Edge-to-Edge Layout) Above a List View
The Apple sample code Landmarks project uses a LazyVStack inside a ScrollView. For a List, which you want, you will need to: Put the ContainerView in the List as the first row. Set the listRowBackground of the ContainerView to EmptyView(). Set the listStyle to plain, for listRowBackground to work. Add .background(alignment: .top) { with the background you want for the ContainerView. Use readFrame() to dynamically adjust the height of the background to match the maxY position of the ContainerView. import SwiftUI struct ListHeaderScene: View { @State var headerRect: CGRect? var headerHeight: CGFloat { headerRect?.maxY ?? 0 } var body: some View { List { ContainerView() .readFrame { headerRect = $0 } .listRowSeparator(.hidden) .listRowBackground(EmptyView()) Section(Section Title) { Text(Row 1) Text(Row 2) } } .listStyle(.plain) .background(alignment: .top) { // You can swap this for an image or whatever. Color.purple .frame(height: headerHeight) .ignoresSafeArea() } } } struc
Topic: UI Frameworks SubTopic: SwiftUI
1w
coreaudio-api mailing list search broken
Hello, The search functionality of the coreaudio-api mailing list archive has been broken for a very long time. Several of the lower-level audio APIs have only been discussed on this mailing list, making it critical for those of us maintaining old audio code. Steps to reproduce: Open https://lists.apple.com/archives/list/coreaudio-api@lists.apple.com/ in your web browser. Enter a search term in the Search this list field in the top-right corner of the page. The search will eventually time out with 502 Bad Gateway Can somebody please forward this information to the current maintainer? I've tried to contact developer support but they weren't sure what to do. Thanks!
1
0
174
1w
Reply to coreaudio-api mailing list search broken
To follow up on this, the search functionality of the archive is still broken. Additionally, the whole lists.apple.com server was down a few days ago. I still haven't received any reply from Apple. In case it helps others, I used the Wayback Machine to create an archive of the old coreaudio-api mailing list. It's available here: https://github.com/iccir/coreaudio-api-archive
1w
System Panic with IOUserSCSIParallelInterfaceController during Dispatch Queue Configuration
Hello everyone, We are in the process of migrating a high-performance storage KEXT to DriverKit. During our initial validation phase, we noticed a performance gap between the DEXT and the KEXT, which prompted us to try and optimize our I/O handling process. Background and Motivation: Our test hardware is a RAID 0 array of two HDDs. According to AJA System Test, our legacy KEXT achieves a write speed of about 645 MB/s on this hardware, whereas the new DEXT reaches about 565 MB/s. We suspect the primary reason for this performance gap might be that the DEXT, by default, uses a serial work-loop to submit I/O commands, which fails to fully leverage the parallelism of the hardware array. Therefore, to eliminate this bottleneck and improve performance, we configured a dedicated parallel dispatch queue (MyParallelIOQueue) for the UserProcessParallelTask method. However, during our implementation attempt, we encountered a critical issue that caused a system-wide crash. The Operatio
21
0
714
1w
ControlWidgetToggle image design
I need help designing the image of a ControlWidgetToggle. do I understand correctly that I can only use an SFSymbol as image and not my custom image (unless setup via a custom SFSymbol)? is there any way I can influence the size of the image? I tried multiple SwiftUI modifiers (.imageScale, .font, .resizable, .controlSize) none of them seem to work. My image remains too tiny the image size of the on and off state is different. Seems to be enforced by the system. Is there any way to make both images use the same size? the on-state tints the image. Is there a way to set the tint color? .tint and .foregroundstyle seem to be ignored. Thank you for your help
1
0
66
3d
Reply to Sticky Horizontal AnchorEntity
Hello @mlbonniec , thank you for your question! I believe what you are looking for is raycast(from:to:query:mask:relativeTo:). You can perform a raycast on the Scene that an Entity belongs to. If you configure an entity with ManipulationComponent, you can subscribe to the event ManipulationEvents.WillRelease to execute code when a person releases an object. Then, you can perform a raycast on the scene downward from the entity's position and place the entity on the closest surface. Here's a quick implementation I threw together demonstrating how to position an Entity on raycast hit: // This code runs when a person releases an object. func handleManipulationWillRelease(event: ManipulationEvents.WillRelease) { // Start the raycast from the position of the entity when it is released. let raycastStart = event.entity.position // End the raycast one meter below the starting point (surfaces further away than 1m will be ignored). let raycastEnd = raycastStart + [0, -1, 0] // Perform the rayc
Topic: Spatial Computing SubTopic: General Tags:
1w