Search results for

SwiftUI List performance

50,609 results found

Post

Replies

Boosts

Views

Activity

Reply to WebSocket connection instantly closes (FIN) on iPadOS 26 in PWA (Local HTTP/WS)
Additional Information: iPhoneSE(Generation unknown - details from client) running iOS 26.0.1: The WebSocket disconnection issue did not occur. Any iPad running iPadOS 26.0.1: I wanted to test this, but I couldn't perform the verification as I didn't have a corresponding device on hand. iPad(A16) running iPadOS 26.2: When accessing directly via the Chrome browser, the WebSocket remained stable and did not disconnect. However, the issue was reproducible when using the PWA version (installed via Chrome). (Does the PWA use the Safari/WebKit engine internally even when installed through Chrome?) Additionally, I found logs corresponding to the time of the occurrence under Settings > Privacy & Security > Analytics & Improvements > Analytics Data. I am attaching those files to this post for reference. ExcUserFault_MobileSafari-2026-01-05-144423.000.ips ExcUserFault_SafariViewService-2026-01-05-144250.ips ExcUserFault_MobileSafari-2026-01-05-143829.ips ExcUserFault_SafariViewService-2026-01-
Topic: Safari & Web SubTopic: General
Jan ’26
Activating a Container App from a Custom Keyboard Extension to Enable Continuous Voice Input While Preserving the Original Typing Context
Project Background: I am developing a third-party custom keyboard for iOS whose primary feature is real-time voice input. In my current design, responsibilities are split as follows: 1. The container (main) app is responsible for: Audio recording Speech recognition (ASR) 2. The keyboard extension is responsible for: Providing the keyboard UI Initiating the voice input workflow Receiving transcription results via an App Group Inserting recognized text into the active text field using textDocumentProxy.insertText(_:) Intended User Flow The intended workflow is: The user is typing in a third-party app (for example, WeChat) using my custom keyboard. The user taps a “Voice Input” button in the keyboard extension. The keyboard extension activates the container app so that audio recording and ASR can begin. After recording has started, control returns to the original app where the user was typing. The container app continues running in the background, maintaining active audio recording and ASR. Recognized text is co
3
0
142
Jan ’26
How to correctly move a TextField selection cursor when inserting UTF16 text
I'm trying to implement a feature whereby a user can tap a button to insert a character at the cursor in a TextField - the cursor then needs to be moved forward to be in front of the insert character. I'm having trouble with characters such as π which are UTF16 encoded. In the following sample app, enter the following sequence: Enter 9 by keyboard tap + Enter 9 by keyboard tap π Enter 9 via keyboard tap + he TextField will show '9+9π+9' (i.e. the final + is inserted before 9 rather than after it. Any insight into what I am doing wrong? import SwiftUI @main struct TextInsertApp: App { var body: some Scene { WindowGroup { ContentView() } } } struct ContentView: View { @State private var text: String = @State private var selection: TextSelection? = nil var body: some View { TextField(, text: $text, selection: $selection) .background(.gray.opacity(0.4)) Button(+) { insert(+) } Button(π) { insert(π) } } func insert(_ insertString: String) { if let selection { if case let .selection(range) = selection.ind
1
0
168
Jan ’26
Reply to Text with Liquid Glass effect
This is a great questions and I created my own RoundedRectangle with the fill to look like Liquid Glass even though I'm not a designer I am sure someone can do a better job in SwiftUI than mine. I'm looking to see a picture of what you are trying to accomplish actually. Would you be able to provide that? .background( // Glass material RoundedRectangle(cornerRadius: 22, style: .continuous) .fill(.ultraThinMaterial) .overlay( // Subtle inner highlight and outer stroke for depth RoundedRectangle(cornerRadius: 22, style: .continuous) .strokeBorder(Color.white.opacity(0.35), lineWidth: 1) .blendMode(.overlay) ) .shadow(color: Color.black.opacity(0.12), radius: 16, x: 0, y: 8) // shadow ) Looking forward to other people's design and ideas. Albert Pascual
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
Reply to Tahoe 26.2 breaks printing with PaperCut
So, looking at things from our side, I'm not sure. I found one bug on this (r.166518515) about accessing a custom directory (/Library//), but the analysis of the engineering team is that it isn't a bug in macOS 26.2... because it shouldn't work in macOS 26.0 EITHER. More specifically, it should only be accessing one of these documented directories: 2. Writing of files: pursuant to normal UNIX file permissions, filters and backends can read/write files to the cache directory specified by the CUPS_CACHEDIR environment variable, to the state directory specified by the CUPS_STATEDIR environment variable, to the temporary directory specified by the TMPDIR environment variable, and under the /private/var/db, /private/var/folders, /private/var/lib, /private/var/mysql, /private/var/run, /private/var/spool (except /private/var/spool/cups), /Library/Application Support, /Library/Caches, /Library/Logs, /Library/Preferences, /Library/WebServer, and /Users/Shared directories. FYI, that does suggest a possible workaround
Topic: App & System Services SubTopic: General Tags:
Jan ’26
Reply to Converting between observation methods
Thank you for your post. I find your question quite intriguing, as SwiftUI observable variables are undoubtedly a powerful feature we all use. However, I am not the best developer to provide you examples as I don't use many third parties anymore based on my job. I can provide an example of how I handle third-party libraries that conform to ObservableObject, or at least I did. There is no definitive answer from me, but developers must always adapt to the challenges they encounter. // ObservableObject wrapper for MyObservableType class ObservableTypeAdapter: ObservableObject { @Published private var myObservable: MyObservableType When dealing with imported code that employs a different observation technique than the one you are utilizing in your SwiftUI project, you can bridge the gap between the two by employing certain adaptation techniques. If you have an existing type and require it to be used in a context that expects the macro format, you can create a wrapper that conforms to the expecte
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
UNNotificationAttachment preview intermittently missing (attachment-store URL becomes unreadable)
I have been fighting this problem for two months and would love any help, advice or tips. Should I file a DTS ticket? Summary We attach a JPEG image to a local notification using UNNotificationAttachment. iOS reports the delivered notification as having attachments=1, but intermittently no image preview appears in Notification Center. In correlated cases, the attachment’s UNNotificationAttachment.url (which points into iOS’s attachment store) becomes unreadable (Data(contentsOf:) fails) even though the delivered notification still reports attachments=1. This document describes the investigation, evidence, and mitigations attempted. Product / Component UserNotifications framework UNNotificationAttachment rendering in Notification UI (Notification Center / banner / expanded preview) Environment App: OnThisDay (SwiftUI, Swift 6) Notifications: local notifications scheduled with UNCalendarNotificationTrigger(repeats: false) Attachment: JPEG generated from PhotoKit (PHImageManager.requestImage) and writte
1
0
97
Jan ’26
Apple Developer Program Sales Problem
Hello, I am trying to enroll in the Apple Developer Program, but I am unable to complete the payment and account creation process despite trying multiple times and following all recommended steps. Please note that I am attempting to complete this purchase from Turkey. Below is a detailed list of everything I have tried so far: I tried using different web browsers (Opera, Google Chrome). I tried multiple different debit cards. I also tried using a credit card. I created a brand new Apple ID and attempted enrollment with it. I tried both Gmail-based Apple ID and iCloud-based Apple ID. I attempted to enroll via the Apple Developer app on an iPhone 11. All my card details are correct, and domestic & international transactions are enabled. My address information is correct. I tried both Turkish characters and English characters. I also tried using a VPN, but the issue still persists. Despite all of these attempts, I am still unable to purchase the Apple Developer Program membership. I have contacted s
1
0
164
Jan ’26
BUG: Toolbar Rendering Bug -- ToolbarItem Duplication when Back Button Hidden
To whom it may concern that deals with bugs in SwiftUI for iOS 26: Inadvertently discovered a bug which duplicates ToolbarItem in any placement in the toolbar when navigationBarBackButtonHidden is set to true. .toolbar{ ToolbarItem(placement: .confirmationAction) { Button(Stop, systemImage: stop.fill){ //some action } } } .navigationBarBackButtonHidden(true) Expected Behavior Show the ToolbarItem Actual Behavior Duplicates items in the placement position. Thank you.
1
0
156
Jan ’26
Reply to Text with Liquid Glass effect
You'd need to generate a set of Path instances from the characters in your text. This is only really suitable for small amounts, e.g. the Welcome animation or clock digits, etc., because it's not the most performant thing. Also, bigger text is better. Lastly, remember to wrap it all in a GlassEffectContainer to avoid each character's glass being rendered in a discrete pass. Actually lastly: you'll need to adjust the location of the text using .offset(x:y:) or by tweaking the path creation to include better offset translations. This is my quick & dirty attempt. Since .glassEffect() is designed similarly to a fill API, you need something non-empty to 'fill' with your text. Color.clear gets elided by the rendering engine, but what I've found is that Color.white.opacity(0) works to cause an actual (invisible) view to render and take up space during layout calculations. And now: the code! This was written for tvOS, so it uses BIG fonts and offsets to write big numbers. I had it draw a counter that inc
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
Reply to Building a Full Space app that enables sharing a visionOS experience with nearby users.
Hey @sadaotokuyama, It is technically possible to implement the described experience, however, AVPlaybackCoordinator synchronizes the timing of a single AVPlayer object across devices. In your use case you will need to perform the synchronization across multiple AVPlayer objects yourself. Review Synchronizing data during a SharePlay activity to understand how to accomplish this. Consider sending synchronization timing messages frequently as unreliable so that each user sees the same content, however, when a video starts or stops playing due to user interaction use the reliable delivery mode. The supportsGroupImmersiveSpace flag ensures entities with identical transforms appear in the same relative location for all participants, including both nearby and remote participants. For more information please review Configure your visionOS app for sharing with people nearby. Nearby participants appear naturally via passthrough. Nearby participants do not need to register a spatial Persona. You can share with
Topic: Spatial Computing SubTopic: General Tags:
Jan ’26
help() view modifier
I have a bunch of Buttons with a .help(Text(Help text)) modifier, inside of a VStack which has its own .help() modifier describing the entire section. The VStack help shows up only when I hover over the buttons, and the Button help never shows at all. If I comment out the VStack help, the individual button helps show. How do I get both to show up properly? I want the VStack to show if I am in the roundedBorder, unless I am over a Button with its own .help modifier. import SwiftUI struct BugReport: View { @State private var testp1 = false @State private var testp2 = false var body: some View { VStack { Text(Hello, World!) Button(Test1) { testp1.toggle() } .help(Change the test1) Button(Test2) { testp2.toggle() } .help(Change the test2) } .help(Testing stuff) .roundedBorder(color: .black) } } #Preview { BugReport() }
Topic: UI Frameworks SubTopic: SwiftUI
4
0
354
Jan ’26
Reply to help() view modifier
Hello hacksaw, Thank you for the clarification. It is generally not recommended to have nested .help tooltips, please see the Offering help design guide: Describe only the control that people indicate interest in. When people want to know how to use a specific control, they don’t want to learn how to use nearby controls or how to perform a larger task. You could also consider using the TipKit framework to display contextual hints to users. Alternatively, if the intention of using the .hint modifier is to provide accessibility access, accessibilityLabel(_:) or accessibilityHint(_:) would be the appropriate choices. Please don't hesitate to file a file an enhancement request using Feedback Assistant for us to improve or clarify the behavior. After filing, please post the FB number to this thread. If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why? Thank you for your patience, Richard Yeh,  Developer Technical Support
Topic: UI Frameworks SubTopic: SwiftUI
Jan ’26
When trying to run SwiftUI previews, it fails with "SimulatorShutdownUnexpectedlyError - Simulator was shutdown during an update"
My main app target builds fine and can run on Simulator without issue. Whenever I try to run a Preview, I get this error: == DATE: Monday, November 3, 2025 at 2:52:23 PM Pacific Standard Time 2025-11-03T22:52:23Z == PREVIEW UPDATE ERROR: SimulatorShutdownUnexpectedlyError: Simulator was shutdown during an update Simulator [F85A5AF1-F52C-4662-AFCD-762F87AF537D] failed to boot and may have crashed. This seems like it started happening after updating to MacOS 26. I've tried reinstalling all Simulators, tried on Xcode 26, deleted derived data, restarted Xcode and my Mac several times. What other troubleshooting steps can I take?
4
0
234
Jan ’26