Search results for

SwiftUI List performance

50,609 results found

Post

Replies

Boosts

Views

Activity

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
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
Enrollment on hold - sanctions list false positive - no response after submitting documents
Hi everyone, I'm reaching out because I've been stuck in enrollment limbo for over a week and Apple support hasn't responded. My situation: Applied for Apple Developer Program Received email saying my enrollment is on hold because my name fully or partially matches someone on the U.S. consolidated screening list Verified my identity via the upload portal on December 30, 2025 (submitted passport) Sent follow-up email confirming document submission Checked the screening list at legacy.export.gov/csl-search - my name is NOT listed I've received no response, no confirmation of document receipt, and no timeline for resolution. Has anyone else experienced this false positive situation? How long did it take to resolve? Any tips for getting a response from Apple Developer Relations? This is blocking my app development work and I'd appreciate any advice from the community. Thanks!
0
0
100
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
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
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
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
Reply to SwiftUI using Mac Catalyst destination the destination but provided destination is iPhone 17 Pro
Thank you for your post. May I request that you create a focused sample that developers in the forums can run and observe the results? When running a SwiftUI app designed for iPad on Mac Catalyst, it can be challenging to ensure that the UI scales appropriately and fills the available screen space. However I am confused your iPad target is an iPhone 17? Ensure that your main view is set to expand and fill the available space. You can try using to understand the available space and adjust your layout accordingly. Mac Catalyst provides specific modifiers and environment values you can leverage to better adapt your UI. Ensure that the Mac Catalyst app’s window toolbar isn’t consuming excessive space or causing layout issues. Test your app with different Mac resolutions or window sizes to confirm whether the layout issue is specific to certain dimensions or more general. Since you are using Xcode 26.2 (17C52), ensure that you are also on the latest version of macOS. I look forward to seeing your focused
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
Navigation title is not visible in root of navigation stack of UITabBarController using UITab layout on iPad
Description Title of the view controller is not displayed for the 1st view controller in navigation stack. Is there a way to show it? Main problem is that selected tab is a UITabGroup and there's no way to understand which child of it is currently selected without opening the sidebar or guessing by the content. Human Interface Guidelines In the guidelines there are examples with title visible on the iPad in similar case: https://developer.apple.com/design/human-interface-guidelines/tab-bars Code import UIKit import SwiftUI struct TestView: View { var tab: UITab? let id = UUID() var body: some View { ScrollView { HStack { Spacer() VStack { Text(tab?.title ?? id.uuidString) } Spacer() } .frame(height: 1000) .background(.red) .onTapGesture { tab?.viewController?.navigationController?.pushViewController( TestViewController(nil), animated: true ) } } } } class TestViewController: UIHostingController { let _tab: UITab? init(_ tab: UITab?) { self._tab = tab super.init(rootView: TestView(tab: _tab)) } @MainA
Topic: UI Frameworks SubTopic: UIKit
4
0
266
Jan ’26
App Store Connect API / altool uploads validate IPA against wrong app when multiple apps share account; Transporter succeeds
When uploading an iOS IPA via App Store Connect API or altool, App Store Connect validates the IPA against the wrong existing app record, even though the IPA is correctly signed and provisioned. The exact same IPA uploads successfully via Apple Transporter, which correctly routes it to the intended app. This appears to be an App Store Connect upload-resolution issue specific to API-based delivery. Environment Account: App Store Connect (Admin access) Authentication: App Store Connect API Key (Issuer ID + Key ID) Apps in Account: com.dailyaudiobible.dabapp Apple ID: 121xxxx266 com.dailyaudiobible.dabapp2 Apple ID: 645xxxx428 iOS / SDK Details Platform: iOS Build Artifact: Single signed IPA used for all tests Target SDK: iOS 18.5 Xcode: 16.4 .NET iOS SDK: 18.5.9227 Minimum iOS Version: 18.5 Architecture: ios-arm64 Build Type: App Store distribution (Release) This SDK/Xcode combination previously worked for TestFlight uploads of this app. Expected Behavior When uploading an IPA with: CFBundleIdentifier = com.dai
1
0
154
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
SwiftUI using Mac Catalyst destination the destination but provided destination is iPhone 17 Pro
Using SwiftIUI with CommandGroup for iPad app on Xcode Version 26.2 (17C52). I tried to test on Mac Catalyst. Output view is iPad size but my SwiftUI view is small on the left. I tried to override the frame size used but none of the suggested ways compiled. Used both Scaled for iPad and Optimized for Mac in deployment Info with same results.
1
0
107
Jan ’26
Reply to In app purchases
// StoreView.swift import StoreKit import SwiftUI struct StoreView: View { @ObservedObject private var storeController = StoreActor.shared.productController var hasPro: Bool { storeController.isEntitled } var body: some View { if let product = storeController.product, !storeController.isEntitled { // Pro features available to the user TO PURCHASE if(product.displayName == ProductNames.pro.humanReadablePurchaseLevel()) { // Show the product in a nice way, using the properties of the `product` variable ProductRow(product: product) } } if(hasPro) { // The user has already purchased the pro version, so show the pro features } } } struct ProductRow: View { @ObservedObject private var storeController = StoreActor.shared.productController var product: Product var body: some View { Text(Upgrade to (product.displayName)) Text(product.description) // Purchase button Button { Task(priority: .userInitiated) { await storeController.purchase() } } label: { Text((product.displayPrice)) } } }
Jan ’26
Clarification Needed: histogrammedTimeToFirstDraw vs histogrammedOptimizedTimeToFirstDraw in MetricKit
Hi Apple Developer Community, I'm implementing MetricKit launch performance tracking in our iOS app and need clarification on two properties: histogrammedTimeToFirstDraw histogrammedOptimizedTimeToFirstDraw The Documentation Problem: The official MetricKit documentation provides minimal explanation of these properties beyond their names. Based on naming conventions, I initially assumed: histogrammedTimeToFirstDraw = cold launches histogrammedOptimizedTimeToFirstDraw = warm/optimized launches Based on our measurements: The “optimized” metric appears only in a small fraction of launches The optimized metric is actually slower The naming suggests the opposite behavior Questions: What specific launch conditions does each metric measure? Why would optimized launches be slower and less frequent? Is histogrammedOptimizedTimeToFirstDraw related to iOS app pre-warming or prediction features? If these metrics don’t correspond to cold vs. warm launch times, is there an alternative way to measure them accurately
0
0
194
Jan ’26
NSHostingView stops receiving mouse events when layered above another NSHostingView (macOS Tahoe 26.2)
I’m running into a problem with SwiftUI/AppKit event handling on macOS Tahoe 26.2. I have a layered view setup: Bottom: AppKit NSView (NSViewRepresentable) Middle: SwiftUI view in an NSHostingView with drag/tap gestures Top: Another SwiftUI view in an NSHostingView On macOS 26.2, the middle NSHostingView no longer receives mouse or drag events when the top NSHostingView is present. Events pass through to the AppKit view below. Removing the top layer immediately restores interaction. Everything works correctly on macOS Sequoia. I’ve posted a full reproducible example and detailed explanation on Stack Overflow, including a single-file demo: Stack Overflow post: https://stackoverflow.com/q/79862332 I also found a related older discussion here, but couldn’t get the suggested workaround to apply: https://developer.apple.com/forums/thread/759081 Any guidance would be appreciated. Thanks!
4
0
351
Jan ’26