Search results for

SwiftUI List performance

50,605 results found

Post

Replies

Boosts

Views

Activity

Reply to SwiftUI subviews traverse issue
No, I don't think there is a way to find a SwiftUI view via its accessibilityIdentifier. If your intent is to retrieve the frame of a Text and do something based on that in a parent view, GeometryReader + PreferenceKey / anchorPreference will be the way to go, even though it needs some additional code. In iOS 16, onGeometryChange(for:of:action:) allows you to perform an action when a geometry value of a view changes. If you target iOS 16 and later, that may be even easier. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI
3w
SwiftUI: AlignmentGuide in Overlay not working when in if block
Scenario A SwiftUI view has an overlay with alignment: .top, the content uses .alignmentGuide(.top) {} to adjust the placement. Issue When the content of the overlay is in an if-block, the alignment guide is not adjusted. Example code The example shows 2 views. Not working example, where the content is an if-block. Working example, where the content is not in an if-block Screenshot: https://github.com/simonnickel/FB15248296-SwiftUIAlignmentGuideInOverlayConditional/blob/main/screenshot.png Tested on - Xcode Version 16.0 RC (16A242) on iOS 18.0 Code // Not working .overlay(alignment: .top) { if true { // This line causes .alignmentGuide() to fail Text(Test) .alignmentGuide(.top, computeValue: { dimension in dimension[.bottom] }) } } // Working .overlay(alignment: .top) { Text(Test) .alignmentGuide(.top, computeValue: { dimension in dimension[.bottom] }) } Also created a Feedback: FB15248296 Example Project is here: https://github.com/simonnickel/FB15248296-SwiftUIAlignmentGuideInOverlayConditional/tre
2
0
477
3w
Krazy Krownz multiplayer option not working for Game Center!
When trying to play with friends Krazy Krownz doesn’t allow me to click multiplayer even though my Apple Game Center connected and my friends Apple game center connected as well. I even tried sending an invite from Apple Game Center to friends and Krazy Krownz doesn’t even show up on the list of available multiplayer games. I’ve signed out and back in the same issue remain. I’ve try to contact the game developer, but the website doesn’t work.
1
0
258
3w
How to make fluid TabBar
Hey there guys, I'm new on SwiftUI and iOS Development world. How can I achieve a seamless TabBar transition in SwiftUI? Currently, when I programmatically hide the TabBar on a pushed view and swipe back to the previous view, there is a noticeable delay before the TabBar reappears. How can I make it appear instantly? Here is the link to the video https://streamable.com/3zz2o2 Thank you in advance
Topic: UI Frameworks SubTopic: SwiftUI
2
0
124
3w
[iOS 26 presentOfferCodeRedeemSheet] Custom Offer Code fails with "The code entered is not valid"
Hello everyone, I'm having trouble testing custom offer codes for my auto-renewable subscription in the Sandbox environment. I am using the modern StoreKit 2 API to display the redemption sheet: try await StoreKit.AppStore.presentOfferCodeRedeemSheet(in: windowScene) When I enter a valid custom code that I created in App Store Connect, the system sheet immediately returns the following error: Cannot Redeem Code. The code entered is not valid. [environment: sandbox] To be clear, I am manually typing the custom code string itself into the redemption sheet's text field, not using a one-time code link or URL. I believe my configuration is correct, and I've already spent a significant amount of time troubleshooting. Here is a list of everything I have checked and tried so far: App Store Connect Configuration: The Offer Code is marked as Active. The parent subscription product is approved and its status is Ready for Sale. The offer's eligibility is set correctly The start and end dates for the offer are va
1
0
287
3w
Errors with PerfPowerTelemetryClientRegistrationService and PPSClientDonation when running iOS application in Xcode
I've suddenly started seeing hundreds of the same block of four error messages (see attached image) when running my app on my iOS device through Xcode. I've tried Cleaning the Build folder, but I keep seeing these messages in the console but can't find anything about them. Phone is running iOS 26.1. Xcode is at 16.4. Mac is on Sequoia 15.5. The app is primarily a MapKit SwiftUI based application. Messages below: Connection error: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.PerfPowerTelemetryClientRegistrationService was invalidated: Connection init failed at lookup with error 159 - Sandbox restriction. UserInfo={NSDebugDescription=The connection to service named com.apple.PerfPowerTelemetryClientRegistrationService was invalidated: Connection init failed at lookup with error 159 - Sandbox restriction.} (+[PPSClientDonation isRegisteredSubsystem:category:]) Permission denied: Maps / SpringfieldUsage (+[PPSClientDonation sendEventWithIdentifier:payload:]) Invalid
6
0
354
3w
Reply to Errors with PerfPowerTelemetryClientRegistrationService and PPSClientDonation when running iOS application in Xcode
On the workaround front, you’re using MKMapView via UIViewRepresentable. If you switch to the shiny new Map SwiftUI view, does that avoid the problem? Haha I knew you were going to say that. :) Probably, but we still support back to iOS 16 so that's not currently an option. And, since it's just annoying log entries... Another option is to filter these log entries out in Xcode: Thanks for that! I also found the right-click / hide option in the logs that allow the filtering by various categories which definitely helps a lot. As always, thanks so much for your help.
3w
`import Collections` does make no sense errors.
I downloaded package, I can see it in Package Dependencies tab, [swift-collections | https://github.com/apple/swift-collections.git | Up to Next Major Version] — looks OK. But (quite strange): import Collections //🛑 No such module 'Collections' typealias Objects = OrderedSet // No error I took Collection word from a list or typed — no difference. if I remove import Collections there is no OrderedSet anymore (of course) Can't compile. Cleaned build folder, restarted Xcode... What could be wrong with it? Any ideas?
1
0
34
3w
Reply to Errors with PerfPowerTelemetryClientRegistrationService and PPSClientDonation when running iOS application in Xcode
[quote='873874022, FT-cfoy, /thread/811791?answerId=873874022#873874022, /profile/FT-cfoy'] I wish I could ignore it [/quote] )-; [quote='873870022, FT-cfoy, /thread/811791?answerId=873870022#873870022, /profile/FT-cfoy'] I've submitted a bug report with this FB21768382 [/quote] Thanks. That’s definitely the right choice in this situation. Also, please add a sysdiagnose log to that bug, one taken on your device shortly after reproducing the issue. That helps with the triage. On the workaround front, you’re using MKMapView via UIViewRepresentable. If you switch to the shiny new Map SwiftUI view, does that avoid the problem? Another option is to filter these log entries out in Xcode: Locate the Filter box at the bottom of the Console debug area. Copy the string subsystem:com.apple.PerfPowerServices and paste it into the box. That’ll create a Subsystem filter. In the menu hanging off that filter, select “≠ is not”. For many other systems log hints and tips, see Your Friend the System Log. Share and Enjo
3w
Help with trailing closure errors
I am new to swiftui and have a very small project I am working on to practice passing data between views. I have this error on a form Trailing closure passed to parameter of type 'FormStyleConfiguration' that does not accept a closure If I comment the first section in the form then I get three errors in the ForEach. If anyone can help explain what is going on and what steps I could take to determine where the problem is coming from I would appreciate the help. This is the model I created: import Observation import SwiftUI @Model final class Client { var id = UUID() var name: String var location: String var selectedJob: Person init(id: UUID = UUID(), name: String, location: String, selectedJob: Person) { self.id = id self.name = name self.location = location self.selectedJob = selectedJob } } extension Client { enum Person: String, CaseIterable, Codable { case homeOwner = Home Owner case contractor = Contractor case designer = Designer } } @Model class Enclosure { var id = UUID() var room: St
3
0
1k
3w
Reply to Catalyst: determine the device information when running on Mac
[quote='873863022, DTS Engineer, /thread/813853?answerId=873863022#873863022'] may I ask you to file a bug with that project? [/quote] Before you do that, I’d like to clarify what you mean by this: [quote='813853021, OC_s, /thread/813853, /profile/OC_s'] How do I determine the real values? [/quote] What specific information are you looking for here? And what do you plan to do with that information? This matters because Mac Catalyst is returning values that make sense in the iOS-ish environment that’s expected by such apps. It is possible to get ‘real’ values, but the best way to do that depends on your specific setup. For example, the systemName property is uninteresting in a Mac Catalyst app because the real system name is macOS. So you can do this [1]: let systemName: String #if targetEnvironment(macCatalyst) systemName = macOS #else systemName = device.systemName #endif However, that’s just one of these properties. The best path for the other properties varies based your the specific property and your ulti
Topic: App & System Services SubTopic: Core OS Tags:
3w
Any strategies for leveraging review responses to improve ASO results?
I’ve been building iOS apps since 2011 and have worked on hundreds along the way. Recently, I started a series on App Store Optimization (ASO) to share tips, strategies, and lessons learned. In this first post, I dive into how responding to customer reviews can directly influence ASO performance and App Store ranking - covering timing, response style, and best practices to turn negative reviews into positive ones.
2
0
147
3w
Reply to URL(fileURLWithPath:) behavior change in iOS 26 - Tilde (~) in filename causes unexpected path resolution
@DTS Engineer Our iOS app receives filenames from a server (e.g., ~TestFile.irfd). We need to extract the filename without extension for display purposes. The original code used: func getFileName(fileNameWithExtension: String) -> String { // Pure string manipulation - correct for filename handling let fileName = URL(fileURLWithPath: fileNameWithExtension).lastPathComponent return fileName } This worked on iOS 18, but broke on iOS 26 when customers started using filenames beginning with ~. We don't actually need a URL or path. We're doing pure string manipulation on a filename to extract components. We used URL(fileURLWithPath:) as a convenient way to get lastPathComponent, but that's semantically wrong for our use case. This will be right suitable approach for our case, let fileName = (fileNameWithExtension as NSString).lastPathComponent This is the right approach because: We have a filename, not a path We need string manipulation, not path resolution NSString.lastPathComponent doesn't perform pat
Topic: App & System Services SubTopic: General Tags:
3w
Reply to Errors with PerfPowerTelemetryClientRegistrationService and PPSClientDonation when running iOS application in Xcode
Thanks Quinn. This looks to possibly be an internal Apple bug with MKMapView. I can recreate the issue with the following code: import MapKit import SwiftUI struct MyMapkitView: UIViewRepresentable { typealias UIViewType = MKMapView func makeUIView(context: Context) -> MKMapView { return MKMapView() } func updateUIView(_ uiView: MKMapView, context: Context) {} } struct ContentView: View { var body: some View { VStack { MyMapkitView() } .padding() } } Which immediately gives the errors below that match what I'm seeing in my app. I wish I could ignore it, but it quite literally is happening 2-3 times a second so the log is completely buried with these messages. This only started happening when I upgraded Xcode to 26.
3w
Reply to In-App Provisioning
Thanks for that!! Very useful, I would review each string as the NSExtensionPrincipalClass does not look correct to me but is set by Xcode, but it's been a while since I create an extension, I should try today to create a new one to see how it works. I'll invite extension experts to look at your configuration. As Xcode sets your string must be correct, just make sure the method get called? $(PRODUCT_MODULE_NAME).handler.... https://developer.apple.com/documentation/BundleResources/Information-Property-List/NSExtension/NSExtensionPrincipalClass NSExtensionPointIdentifier com.apple.passkit.issuer-provisioning NSExtensionPrincipalClass $(PRODUCT_MODULE_NAME).IssuerExtensionHandler https://developer.apple.com/documentation/bundleresources/managing-your-app-s-information-property-list#Manually-supply-an-information-property-list-file https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/AppExtensionKeys.html So it I follow the docume
3w